1 // RUN: %clang_cc1 -triple spir64 -fsycl-is-device -verify -fsyntax-only %s
2 // RUN: %clang_cc1 -triple x86_64-linux-gnu -fsycl-is-device -fsyntax-only %s
4 typedef __float128 BIGTY
;
9 // expected-note@+1 {{'field' defined here}}
11 // expected-note@+1 2{{'field1' defined here}}
13 using BIGTYPE
= __float128
;
14 // expected-note@+1 {{'bigfield' defined here}}
20 int B
= sizeof(__float128
);
25 long double ld_func(long double arg
);
28 // expected-note@+1 3{{'A' defined here}}
31 // expected-error@+3 2{{expression requires 128 bit size '__float128' type support, but target 'spir64' does not support it}}
32 // expected-error@+2 {{'A' requires 128 bit size '__float128' type support, but target 'spir64' does not support it}}
33 // expected-error@+1 {{'field1' requires 128 bit size '__float128' type support, but target 'spir64' does not support it}}
35 // expected-error@+2 {{expression requires 128 bit size 'BIGTYPE' (aka '__float128') type support, but target 'spir64' does not support it}}
36 // expected-error@+1 {{'bigfield' requires 128 bit size 'BIGTYPE' (aka '__float128') type support, but target 'spir64' does not support it}}
39 // expected-error@+1 {{'A' requires 128 bit size '__float128' type support, but target 'spir64' does not support it}}
42 // expected-note@+2 {{'BB' defined here}}
43 // expected-error@+1 {{'A' requires 128 bit size '__float128' type support, but target 'spir64' does not support it}}
45 // expected-error@+2 {{expression requires 128 bit size '__float128' type support, but target 'spir64' does not support it}}
46 // expected-error@+1 {{'BB' requires 128 bit size '__float128' type support, but target 'spir64' does not support it}}
51 // expected-error@+1 3{{expression requires 128 bit size '__float128' type support, but target 'spir64' does not support it}}
52 float F3
= ((__float128
)F1
* (__float128
)F2
) / 2.0f
;
54 // assume that long double is supported
55 float F4
= ld_func(F3
);
58 // expected-note@+1 {{called by 'usage'}}
65 // expected-note@+3 {{'P' defined here}}
66 // expected-error@+2 {{'P' requires 128 bit size '__float128' type support, but target 'spir64' does not support it}}
67 // expected-note@+1 2{{'foo' defined here}}
68 __float128
foo(__float128 P
) { return P
; }
70 template <typename Name
, typename Func
>
71 __attribute__((sycl_kernel
)) void kernel(Func kernelFunc
) {
72 // expected-note@+1 5{{called by 'kernel}}
77 // expected-note@+1 {{'CapturedToDevice' defined here}}
78 __float128 CapturedToDevice
= 1;
80 kernel
<class variables
>([=]() {
81 decltype(CapturedToDevice
) D
;
82 // expected-error@+1 {{'CapturedToDevice' requires 128 bit size '__float128' type support, but target 'spir64' does not support it}}
83 auto C
= CapturedToDevice
;
85 // expected-error@+2 {{expression requires 128 bit size '__float128' type support, but target 'spir64' does not support it}}
86 // expected-error@+1 {{'field1' requires 128 bit size '__float128' type support, but target 'spir64' does not support it}}
88 // expected-error@+2 {{expression requires 128 bit size '__float128' type support, but target 'spir64' does not support it}}
89 // expected-error@+1 {{'field' requires 128 bit size '__float128' type support, but target 'spir64' does not support it}}
93 kernel
<class functions
>([=]() {
94 // expected-note@+1 2{{called by 'operator()'}}
96 // expected-note@+1 {{'BBBB' defined here}}
98 // expected-note@+3 {{called by 'operator()'}}
99 // expected-error@+2 {{'BBBB' requires 128 bit size 'BIGTY' (aka '__float128') type support, but target 'spir64' does not support it}}
100 // expected-error@+1 2{{'foo' requires 128 bit size '__float128' type support, but target 'spir64' does not support it}}
104 kernel
<class ok
>([=]() {
107 auto A
= sizeof(CapturedToDevice
);