1 // Test this without pch.
2 // RUN
: %clang_cc1 %s -triple spir-unknown-unknown -verify -pedantic -fsyntax-only
5 // RUN
: %clang_cc1 -x cl %S
/extension-begin.h -triple spir-unknown-unknown -emit-pch -o %t.pch -pedantic
6 // RUN
: %clang_cc1 %s -triple spir-unknown-unknown -include-pch %t.pch -DIMPLICIT_INCLUDE -DUSE_PCH -fsyntax-only -verify -pedantic
9 // RUN
: rm -rf %t.modules
10 // RUN
: mkdir -p %t.modules
12 // RUN
: %clang_cc1 -cl-std
=CL1.2 -DIMPLICIT_INCLUDE -include %S
/extension-begin.h -triple spir-unknown-unknown -O0 -emit-llvm -o - -fmodules -fimplicit-module-maps -fmodules-cache-path
=%t.modules %s -verify -pedantic
14 // RUN
: rm -rf %t.modules
15 // RUN
: mkdir -p %t.modules
17 // RUN
: %clang_cc1 -cl-std
=CL2.0 -DIMPLICIT_INCLUDE -include %S
/extension-begin.h -triple spir-unknown-unknown -O0 -emit-llvm -o - -fmodules -fimplicit-module-maps -fmodules-cache-path
=%t.modules %s -verify -pedantic
19 #pragma OPENCL EXTENSION my_ext
: enable
20 #ifndef IMPLICIT_INCLUDE
21 // expected-warning
@-
2 {{unknown OpenCL extension
'my_ext
' - ignoring
}}
22 // expected-warning
@+2 {{unknown OpenCL extension
'my_ext
' - ignoring
}}
23 #endif
// IMPLICIT_INCLUDE
24 #pragma OPENCL EXTENSION my_ext
: disable
26 #ifndef IMPLICIT_INCLUDE
27 #include
"extension-begin.h"
28 #endif
// IMPLICIT_INCLUDE
30 // expected-warning
@extension-begin.h
:4 {{expected
'disable
' - ignoring
}}
31 // expected-warning
@extension-begin.h
:5 {{expected
'disable
' - ignoring
}}
32 // expected-warning
@extension-begin.h
:21 {{OpenCL extension end directive mismatches begin directive - ignoring
}}
35 #pragma OPENCL EXTENSION my_ext
: enable
42 #pragma OPENCL EXTENSION my_ext
: disable
44 struct A test_A2
; // expected-error {{use of type 'struct A' requires my_ext extension to be enabled}}
45 const struct A test_A_local
; // expected-error {{use of type 'struct A' requires my_ext extension to be enabled}}
46 TypedefOfA test_typedef_A
; // expected-error {{use of type 'TypedefOfA' (aka 'struct A') requires my_ext extension to be enabled}}
47 PointerOfA test_A_pointer
; // expected-error {{use of type 'PointerOfA' (aka 'const __private struct A *') requires my_ext extension to be enabled}}
48 f
(); // expected-error {{use of declaration 'f' requires my_ext extension to be enabled}}
49 g
(0); // expected-error {{no matching function for call to 'g'}}
50 // expected-note
@extension-begin.h
:18 {{candidate unavailable as it requires OpenCL extension
'my_ext
' to be enabled
}}
51 // expected-note
@extension-begin.h
:23 {{candidate function not viable
: requires
0 arguments
, but
1 was provided
}}