1 // RUN: %clang_cc1 -triple spir64 -aux-triple x86_64-unknown-linux-gnu \
2 // RUN: -fsycl-is-device -verify -fsyntax-only %s
4 typedef __uint128_t BIGTY
;
9 // expected-note@+1 {{'field' defined here}}
11 // expected-note@+1 2{{'field1' defined here}}
13 using BIGTYPE
= __int128
;
14 // expected-note@+1 {{'bigfield' defined here}}
20 int B
= sizeof(__int128
);
26 // expected-note@+1 3{{'A' defined here}}
29 // expected-error@+3 2{{expression requires 128 bit size '__int128' type support, but target 'spir64' does not support it}}
30 // expected-error@+2 {{'A' requires 128 bit size '__int128' type support, but target 'spir64' does not support it}}
31 // expected-error@+1 {{'field1' requires 128 bit size '__int128' type support, but target 'spir64' does not support it}}
33 // expected-error@+2 {{expression requires 128 bit size 'BIGTYPE' (aka '__int128') type support, but target 'spir64' does not support it}}
34 // expected-error@+1 {{'bigfield' requires 128 bit size 'BIGTYPE' (aka '__int128') type support, but target 'spir64' does not support it}}
37 // expected-error@+1 {{'A' requires 128 bit size '__int128' type support, but target 'spir64' does not support it}}
40 // expected-note@+2 {{'BB' defined here}}
41 // expected-error@+1 {{'A' requires 128 bit size '__int128' type support, but target 'spir64' does not support it}}
43 // expected-error@+2 {{expression requires 128 bit size '__int128' type support, but target 'spir64' does not support it}}
44 // expected-error@+1 {{'BB' requires 128 bit size '__int128' type support, but target 'spir64' does not support it}}
48 // expected-note@+1 {{called by 'usage'}}
55 // expected-note@+3 {{'P' defined here}}
56 // expected-error@+2 {{'P' requires 128 bit size '__int128' type support, but target 'spir64' does not support it}}
57 // expected-note@+1 2{{'foo' defined here}}
58 __int128
foo(__int128 P
) { return P
; }
61 // expected-note@+1 {{'operator __int128' defined here}}
62 struct X
{ operator __int128() const; } x
;
64 // expected-error@+2 2{{expression requires 128 bit size '__int128' type support, but target 'spir64' does not support it}}
65 // expected-error@+1 {{'operator __int128' requires 128 bit size '__int128' type support, but target 'spir64' does not support it}}
69 template <typename Name
, typename Func
>
70 __attribute__((sycl_kernel
)) void kernel(Func kernelFunc
) {
71 // expected-note@+1 6{{called by 'kernel}}
76 // expected-note@+1 {{'CapturedToDevice' defined here}}
77 __int128 CapturedToDevice
= 1;
79 kernel
<class variables
>([=]() {
80 decltype(CapturedToDevice
) D
;
81 // expected-error@+1 {{'CapturedToDevice' requires 128 bit size '__int128' type support, but target 'spir64' does not support it}}
82 auto C
= CapturedToDevice
;
84 // expected-error@+2 {{expression requires 128 bit size '__int128' type support, but target 'spir64' does not support it}}
85 // expected-error@+1 {{'field1' requires 128 bit size '__int128' type support, but target 'spir64' does not support it}}
87 // expected-error@+2 {{expression requires 128 bit size '__int128' type support, but target 'spir64' does not support it}}
88 // expected-error@+1 {{'field' requires 128 bit size '__int128' type support, but target 'spir64' does not support it}}
92 kernel
<class functions
>([=]() {
93 // expected-note@+1 2{{called by 'operator()'}}
95 // expected-note@+1 {{'BBBB' defined here}}
97 // expected-error@+3 {{'BBBB' requires 128 bit size 'BIGTY' (aka 'unsigned __int128') type support, but target 'spir64' does not support it}}
98 // expected-error@+2 2{{'foo' requires 128 bit size '__int128' type support, but target 'spir64' does not support it}}
99 // expected-note@+1 1{{called by 'operator()'}}
101 // expected-note@+1 {{called by 'operator()'}}
105 kernel
<class ok
>([=]() {
108 auto A
= sizeof(CapturedToDevice
);
121 struct X
{ operator __int128() const; } x
;
122 bool a
= x
== __int128(0);