[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / CodeGenOpenCL / spir_version.cl
blobb0fa0c2355af973a7c099248d410d74fca4ee65d
1 // RUN: %clang_cc1 %s -triple "spir-unknown-unknown" -emit-llvm -o - -cl-std=CL1.0 | FileCheck %s --check-prefix=CHECK-SPIR-CL10
2 // RUN: %clang_cc1 %s -triple "spir-unknown-unknown" -emit-llvm -o - -cl-std=CL1.2 | FileCheck %s --check-prefix=CHECK-SPIR-CL12
3 // RUN: %clang_cc1 %s -triple "spir-unknown-unknown" -emit-llvm -o - -cl-std=CL2.0 | FileCheck %s --check-prefix=CHECK-SPIR-CL20
4 // RUN: %clang_cc1 %s -triple "spir64-unknown-unknown" -emit-llvm -o - -cl-std=CL1.0 | FileCheck %s --check-prefix=CHECK-SPIR-CL10
5 // RUN: %clang_cc1 %s -triple "spir64-unknown-unknown" -emit-llvm -o - -cl-std=CL1.2 | FileCheck %s --check-prefix=CHECK-SPIR-CL12
6 // RUN: %clang_cc1 %s -triple "spir64-unknown-unknown" -emit-llvm -o - -cl-std=CL2.0 | FileCheck %s --check-prefix=CHECK-SPIR-CL20
8 // RUN: %clang_cc1 %s -triple "spir64-unknown-unknown" -emit-llvm -o - -cl-std=clc++ | FileCheck %s --check-prefix=CHECK-SPIR-CL20
10 // RUN: %clang_cc1 %s -triple "amdgcn--amdhsa" -emit-llvm -o - -cl-std=CL1.0 | FileCheck %s --check-prefix=CHECK-AMDGCN-CL10
11 // RUN: %clang_cc1 %s -triple "amdgcn--amdhsa" -emit-llvm -o - -cl-std=CL1.2 | FileCheck %s --check-prefix=CHECK-AMDGCN-CL12
12 // RUN: %clang_cc1 %s -triple "amdgcn--amdhsa" -emit-llvm -o - -cl-std=CL2.0 | FileCheck %s --check-prefix=CHECK-AMDGCN-CL20
14 kernel void foo() {}
15 kernel void bar() {}
17 // CHECK-SPIR-CL10-DAG: !opencl.spir.version = !{[[SPIR:![0-9]+]]}
18 // CHECK-SPIR-CL10-DAG: !opencl.ocl.version = !{[[OCL:![0-9]+]]}
19 // CHECK-SPIR-CL10-DAG: [[SPIR]] = !{i32 1, i32 2}
20 // CHECK-SPIR-CL10-DAG: [[OCL]] = !{i32 1, i32 0}
21 // CHECK-SPIR-CL12-DAG: !opencl.spir.version = !{[[VER:![0-9]+]]}
22 // CHECK-SPIR-CL12-DAG: !opencl.ocl.version = !{[[VER]]}
23 // CHECK-SPIR-CL12: [[VER]] = !{i32 1, i32 2}
25 // CHECK-SPIR-CL20-DAG: !opencl.spir.version = !{[[VER:![0-9]+]]}
26 // CHECK-SPIR-CL20-DAG: !opencl.ocl.version = !{[[VER]]}
27 // CHECK-SPIR-CL20: [[VER]] = !{i32 2, i32 0}
29 // CHECK-AMDGCN-CL10-NOT: !opencl.spir.version
30 // CHECK-AMDGCN-CL10: !opencl.ocl.version = !{[[OCL:![0-9]+]]}
31 // CHECK-AMDGCN-CL10: [[OCL]] = !{i32 1, i32 0}
32 // CHECK-AMDGCN-CL12-NOT: !opencl.spir.version
33 // CHECK-AMDGCN-CL12: !opencl.ocl.version = !{[[OCL:![0-9]+]]}
34 // CHECK-AMDGCN-CL12: [[OCL]] = !{i32 1, i32 2}
35 // CHECK-AMDGCN-CL20-NOT: !opencl.spir.version
36 // CHECK-AMDGCN-CL20: !opencl.ocl.version = !{[[OCL:![0-9]+]]}
37 // CHECK-AMDGCN-CL20: [[OCL]] = !{i32 2, i32 0}