[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / CodeGenOpenCL / address-spaces-mangling.cl
blob9e59bad4db54dac961771e1dbb0555fb785c59e0
1 // RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=yes -triple %itanium_abi_triple -emit-llvm -o - | FileCheck -check-prefixes="ASMANG,ASMANG10" %s
2 // RUN: %clang_cc1 %s -cl-std=CL2.0 -ffake-address-space-map -faddress-space-map-mangling=yes -triple %itanium_abi_triple -emit-llvm -o - | FileCheck -check-prefixes="ASMANG,ASMANG20" %s
3 // RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=no -triple %itanium_abi_triple -emit-llvm -o - | FileCheck -check-prefixes="NOASMANG,NOASMANG10" %s
4 // RUN: %clang_cc1 %s -cl-std=CL2.0 -ffake-address-space-map -faddress-space-map-mangling=no -triple %itanium_abi_triple -emit-llvm -o - | FileCheck -check-prefixes="NOASMANG,NOASMANG20" %s
5 // RUN: %clang_cc1 %s -cl-std=CL3.0 -cl-std=CL3.0 -cl-ext=-all,+__opencl_c_generic_address_space -ffake-address-space-map -faddress-space-map-mangling=no -triple %itanium_abi_triple -emit-llvm -o - | FileCheck -check-prefixes="NOASMANG,NOASMANG20" %s
6 // RUN: %clang_cc1 %s -cl-std=CL3.0 -cl-ext=-all,+__opencl_c_generic_address_space -ffake-address-space-map -faddress-space-map-mangling=yes -triple %itanium_abi_triple -emit-llvm -o - | FileCheck -check-prefixes="ASMANG,ASMANG20" %s
8 // We check that the address spaces are mangled the same in both version of OpenCL
9 // RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL2.0 -emit-llvm -o - | FileCheck -check-prefix=OCL-20 %s
10 // RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL1.2 -emit-llvm -o - | FileCheck -check-prefix=OCL-12 %s
11 // RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL3.0 -cl-ext=-all,+__opencl_c_generic_address_space -emit-llvm -o - | FileCheck -check-prefix=OCL-20 %s
12 // RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL3.0 -cl-ext=-all -emit-llvm -o - | FileCheck -check-prefix=OCL-12 %s
13 // RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++2021 -cl-ext=-all,+__opencl_c_generic_address_space -emit-llvm -o - | FileCheck -check-prefix=OCL-20 %s
14 // RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++2021 -cl-ext=-all -emit-llvm -o - | FileCheck -check-prefix=OCL-12 %s
16 // We can't name this f as private is equivalent to default
17 // no specifier given address space so we get multiple definition
18 // warnings, but we do want it for comparison purposes.
19 __attribute__((overloadable))
20 void ff(int *arg) { }
21 // ASMANG10: @_Z2ffPi
22 // ASMANG20: @_Z2ffPU3AS4i
23 // NOASMANG10: @_Z2ffPU9CLprivatei
24 // NOASMANG20: @_Z2ffPU9CLgenerici
25 // OCL-20-DAG: @_Z2ffPU3AS4i
26 // OCL-12-DAG: @_Z2ffPi
28 __attribute__((overloadable))
29 void f(private int *arg) { }
30 // ASMANG: @_Z1fPi
31 // NOASMANG: @_Z1fPU9CLprivatei
32 // OCL-20-DAG: @_Z1fPi
33 // OCL-12-DAG: @_Z1fPi
35 __attribute__((overloadable))
36 void f(global int *arg) { }
37 // ASMANG: @_Z1fPU3AS1i
38 // NOASMANG: @_Z1fPU8CLglobali
39 // OCL-20-DAG: @_Z1fPU3AS1i
40 // OCL-12-DAG: @_Z1fPU3AS1i
42 __attribute__((overloadable))
43 void f(local int *arg) { }
44 // ASMANG: @_Z1fPU3AS3i
45 // NOASMANG: @_Z1fPU7CLlocali
46 // OCL-20-DAG: @_Z1fPU3AS3i
47 // OCL-12-DAG: @_Z1fPU3AS3i
49 __attribute__((overloadable))
50 void f(constant int *arg) { }
51 // ASMANG: @_Z1fPU3AS2i
52 // NOASMANG: @_Z1fPU10CLconstanti
53 // OCL-20-DAG: @_Z1fPU3AS2i
54 // OCL-12-DAG: @_Z1fPU3AS2i
56 #if (__OPENCL_C_VERSION__ == 200) || defined(__opencl_c_generic_address_space)
57 __attribute__((overloadable))
58 void f(generic int *arg) { }
59 // ASMANG20: @_Z1fPU3AS4i
60 // NOASMANG20: @_Z1fPU9CLgenerici
61 // OCL-20-DAG: @_Z1fPU3AS4i
62 #endif