diff options
author | Anastasia Stulova <anastasia.stulova@arm.com> | 2017-02-16 12:27:47 +0000 |
---|---|---|
committer | Anastasia Stulova <anastasia.stulova@arm.com> | 2017-02-16 12:27:47 +0000 |
commit | f5802a7c28a2be35565dc66a16679ba383f4dfd2 (patch) | |
tree | 3c565b0b48282518ec890a461c5d48bb8bb838b1 /test/Headers | |
parent | 20a51bfa6c1c2fdb159b1e53340b8488c966b9a1 (diff) |
[OpenCL] Correct ndrange_t implementation
Removed ndrange_t as Clang builtin type and added
as a struct type in the OpenCL header.
Use type name to do the Sema checking in enqueue_kernel
and modify IR generation accordingly.
Review: D28058
Patch by Dmitry Borisenkov!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295311 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Headers')
-rw-r--r-- | test/Headers/opencl-c-header.cl | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/Headers/opencl-c-header.cl b/test/Headers/opencl-c-header.cl index fffbd7a8ed..2c28be19fa 100644 --- a/test/Headers/opencl-c-header.cl +++ b/test/Headers/opencl-c-header.cl @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple spir-unknown-unknown -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s | FileCheck %s -// RUN: %clang_cc1 -triple spir-unknown-unknown -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s -cl-std=CL1.1| FileCheck %s +// RUN: %clang_cc1 -O0 -triple spir-unknown-unknown -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s| FileCheck %s +// RUN: %clang_cc1 -O0 -triple spir-unknown-unknown -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s -cl-std=CL1.1| FileCheck %s // Test including the default header as a module. // The module should be compiled only once and loaded from cache afterwards. @@ -25,26 +25,28 @@ // === // Compile for OpenCL 2.0 for the first time. The module should change. -// RUN: %clang_cc1 -triple spir-unknown-unknown -emit-llvm -o - -cl-std=CL2.0 -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash -ftime-report %s 2>&1 | FileCheck --check-prefix=CHECK20 --check-prefix=CHECK-MOD %s +// RUN: %clang_cc1 -triple spir-unknown-unknown -O0 -emit-llvm -o - -cl-std=CL2.0 -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash -ftime-report %s 2>&1 | FileCheck --check-prefix=CHECK20 --check-prefix=CHECK-MOD %s // RUN: not diff %t/1_0.pcm %t/opencl_c.pcm // RUN: chmod u-w %t/opencl_c.pcm // === // Compile for OpenCL 2.0 for the second time. The module should not change. -// RUN: %clang_cc1 -triple spir-unknown-unknown -emit-llvm -o - -cl-std=CL2.0 -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash -ftime-report %s 2>&1 | FileCheck --check-prefix=CHECK20 --check-prefix=CHECK-MOD %s +// RUN: %clang_cc1 -triple spir-unknown-unknown -O0 -emit-llvm -o - -cl-std=CL2.0 -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash -ftime-report %s 2>&1 | FileCheck --check-prefix=CHECK20 --check-prefix=CHECK-MOD %s // Check cached module works for different OpenCL versions. // RUN: rm -rf %t // RUN: mkdir -p %t // RUN: %clang_cc1 -triple spir64-unknown-unknown -emit-llvm -o - -cl-std=CL1.2 -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -ftime-report %s 2>&1 | FileCheck --check-prefix=CHECK --check-prefix=CHECK-MOD %s -// RUN: %clang_cc1 -triple amdgcn--amdhsa -emit-llvm -o - -cl-std=CL2.0 -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -ftime-report %s 2>&1 | FileCheck --check-prefix=CHECK20 --check-prefix=CHECK-MOD %s +// RUN: %clang_cc1 -triple amdgcn--amdhsa -O0 -emit-llvm -o - -cl-std=CL2.0 -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -ftime-report %s 2>&1 | FileCheck --check-prefix=CHECK20 --check-prefix=CHECK-MOD %s // RUN: chmod u-w %t // RUN: %clang_cc1 -triple spir64-unknown-unknown -emit-llvm -o - -cl-std=CL1.2 -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -ftime-report %s 2>&1 | FileCheck --check-prefix=CHECK --check-prefix=CHECK-MOD %s -// RUN: %clang_cc1 -triple amdgcn--amdhsa -emit-llvm -o - -cl-std=CL2.0 -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -ftime-report %s 2>&1 | FileCheck --check-prefix=CHECK20 --check-prefix=CHECK-MOD %s +// RUN: %clang_cc1 -triple amdgcn--amdhsa -O0 -emit-llvm -o - -cl-std=CL2.0 -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -ftime-report %s 2>&1 | FileCheck --check-prefix=CHECK20 --check-prefix=CHECK-MOD %s // RUN: chmod u+w %t // Verify that called builtins occur in the generated IR. +// CHECK-NOT: ndrange_t +// CHECK20: ndrange_t // CHECK: _Z16convert_char_rtec // CHECK-NOT: _Z3ctzc // CHECK20: _Z3ctzc @@ -52,11 +54,9 @@ char f(char x) { #if __OPENCL_C_VERSION__ != CL_VERSION_2_0 return convert_char_rte(x); -#ifdef NO_HEADER - //expected-warning@-2{{implicit declaration of function 'convert_char_rte' is invalid in C99}} -#endif //NO_HEADER #else //__OPENCL_C_VERSION__ + ndrange_t t; return ctz(x); #endif //__OPENCL_C_VERSION__ } |