xref: /aosp_15_r20/external/clang/test/Lexer/opencl-half-literal.cl (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: %clang_cc1 %s -fsyntax-only -verify -triple spir-unknown-unknown
2*67e74705SXin Li
3*67e74705SXin Li#pragma OPENCL EXTENSION cl_khr_fp16 : enable
4*67e74705SXin Li
5*67e74705SXin Liconstant half a = 1.0h;
6*67e74705SXin Liconstant half aa = 1.0H;
7*67e74705SXin Liconstant half b = 1.0hh; // expected-error{{invalid suffix 'hh' on floating constant}}
8*67e74705SXin Liconstant half c = 1.0fh; // expected-error{{invalid suffix 'fh' on floating constant}}
9*67e74705SXin Liconstant half d = 1.0lh; // expected-error{{invalid suffix 'lh' on floating constant}}
10*67e74705SXin Liconstant half e = 1.0hf; // expected-error{{invalid suffix 'hf' on floating constant}}
11