[LV] Add test showing debug output for loops with uncountable BTCs.
[llvm-project.git] / clang / test / SemaOpenCL / extension-begin.cl
blobdc8bd769e2bde44f72fc89f4d495606bc1e88e49
1 // Test this without pch.
2 // RUN: %clang_cc1 %s -triple spir-unknown-unknown -verify -pedantic -fsyntax-only
4 // Test with pch.
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
8 // Test with modules
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 {{OpenCL extension 'my_ext' unknown or does not require pragma - ignoring}}
22 // expected-warning@+2 {{OpenCL extension 'my_ext' unknown or does not require pragma - 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
29 #ifndef USE_PCH
30 // expected-warning@extension-begin.h:4 {{expected 'disable' - ignoring}}
31 // expected-warning@extension-begin.h:5 {{expected 'disable' - ignoring}}
32 #endif // USE_PCH
34 #if defined(IMPLICIT_INCLUDE) && defined(USE_PCH)
35 //expected-no-diagnostics
36 #endif
38 // Tests that the pragmas are accepted for backward compatibility.
39 #pragma OPENCL EXTENSION my_ext : enable
40 #pragma OPENCL EXTENSION my_ext : disable
42 #ifndef my_ext
43 #error "Missing my_ext macro"
44 #endif
46 // When extension is supported its functionality can be used freely.
47 void test(void) {
48 struct A test_A1;
49 f();
50 g(0);