1// RUN: %clang_cc1 %s -triple "spir-unknown-unknown" -emit-llvm -o - | 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 - | 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 7 8 9// RUN: %clang_cc1 %s -triple "spir64-unknown-unknown" -emit-llvm -o - -cl-std=clc++ | FileCheck %s --check-prefix=CHECK-SPIR-CL20 10 11// RUN: %clang_cc1 %s -triple "amdgcn--amdhsa" -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-AMDGCN-CL10 12// RUN: %clang_cc1 %s -triple "amdgcn--amdhsa" -emit-llvm -o - -cl-std=CL1.2 | FileCheck %s --check-prefix=CHECK-AMDGCN-CL12 13// RUN: %clang_cc1 %s -triple "amdgcn--amdhsa" -emit-llvm -o - -cl-std=CL2.0 | FileCheck %s --check-prefix=CHECK-AMDGCN-CL20 14 15kernel void foo() {} 16kernel void bar() {} 17 18// CHECK-SPIR-CL10-DAG: !opencl.spir.version = !{[[SPIR:![0-9]+]]} 19// CHECK-SPIR-CL10-DAG: !opencl.ocl.version = !{[[OCL:![0-9]+]]} 20// CHECK-SPIR-CL10-DAG: [[SPIR]] = !{i32 1, i32 2} 21// CHECK-SPIR-CL10-DAG: [[OCL]] = !{i32 1, i32 0} 22// CHECK-SPIR-CL12-DAG: !opencl.spir.version = !{[[VER:![0-9]+]]} 23// CHECK-SPIR-CL12-DAG: !opencl.ocl.version = !{[[VER]]} 24// CHECK-SPIR-CL12: [[VER]] = !{i32 1, i32 2} 25 26// CHECK-SPIR-CL20-DAG: !opencl.spir.version = !{[[VER:![0-9]+]]} 27// CHECK-SPIR-CL20-DAG: !opencl.ocl.version = !{[[VER]]} 28// CHECK-SPIR-CL20: [[VER]] = !{i32 2, i32 0} 29 30// CHECK-AMDGCN-CL10-NOT: !opencl.spir.version 31// CHECK-AMDGCN-CL10: !opencl.ocl.version = !{[[OCL:![0-9]+]]} 32// CHECK-AMDGCN-CL10: [[OCL]] = !{i32 1, i32 0} 33// CHECK-AMDGCN-CL12-NOT: !opencl.spir.version 34// CHECK-AMDGCN-CL12: !opencl.ocl.version = !{[[OCL:![0-9]+]]} 35// CHECK-AMDGCN-CL12: [[OCL]] = !{i32 1, i32 2} 36// CHECK-AMDGCN-CL20-NOT: !opencl.spir.version 37// CHECK-AMDGCN-CL20: !opencl.ocl.version = !{[[OCL:![0-9]+]]} 38// CHECK-AMDGCN-CL20: [[OCL]] = !{i32 2, i32 0} 39