blob: 50622f099143067ef12e26fb3b711ccd19d1059d [file] [log] [blame]
Anastasia Stulovaa4b1cf32019-01-31 15:23:48 +00001// 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
David Tweed31d09b02013-09-13 12:04:22 +00005
Alexey Badera60db592016-12-07 08:43:49 +00006// We check that the address spaces are mangled the same in both version of OpenCL
7// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL2.0 -emit-llvm -o - | FileCheck -check-prefix=OCL-20 %s
8// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL1.2 -emit-llvm -o - | FileCheck -check-prefix=OCL-12 %s
9
David Tweed31d09b02013-09-13 12:04:22 +000010// We can't name this f as private is equivalent to default
11// no specifier given address space so we get multiple definition
12// warnings, but we do want it for comparison purposes.
13__attribute__((overloadable))
14void ff(int *arg) { }
Yaxun Liub7318e02017-10-13 03:37:48 +000015// ASMANG10: @_Z2ffPi
16// ASMANG20: @_Z2ffPU3AS4i
Anastasia Stulovaa4b1cf32019-01-31 15:23:48 +000017// NOASMANG10: @_Z2ffPU9CLprivatei
Yaxun Liub7318e02017-10-13 03:37:48 +000018// NOASMANG20: @_Z2ffPU9CLgenerici
Alexey Badera60db592016-12-07 08:43:49 +000019// OCL-20-DAG: @_Z2ffPU3AS4i
20// OCL-12-DAG: @_Z2ffPi
David Tweed31d09b02013-09-13 12:04:22 +000021
22__attribute__((overloadable))
23void f(private int *arg) { }
24// ASMANG: @_Z1fPi
Yaxun Liub7318e02017-10-13 03:37:48 +000025// NOASMANG: @_Z1fPU9CLprivatei
Alexey Badera60db592016-12-07 08:43:49 +000026// OCL-20-DAG: @_Z1fPi
27// OCL-12-DAG: @_Z1fPi
David Tweed31d09b02013-09-13 12:04:22 +000028
29__attribute__((overloadable))
30void f(global int *arg) { }
31// ASMANG: @_Z1fPU3AS1i
32// NOASMANG: @_Z1fPU8CLglobali
Alexey Badera60db592016-12-07 08:43:49 +000033// OCL-20-DAG: @_Z1fPU3AS1i
34// OCL-12-DAG: @_Z1fPU3AS1i
David Tweed31d09b02013-09-13 12:04:22 +000035
36__attribute__((overloadable))
37void f(local int *arg) { }
Egor Churaev28f00aa2016-12-23 16:11:25 +000038// ASMANG: @_Z1fPU3AS3i
David Tweed31d09b02013-09-13 12:04:22 +000039// NOASMANG: @_Z1fPU7CLlocali
Egor Churaev28f00aa2016-12-23 16:11:25 +000040// OCL-20-DAG: @_Z1fPU3AS3i
41// OCL-12-DAG: @_Z1fPU3AS3i
David Tweed31d09b02013-09-13 12:04:22 +000042
43__attribute__((overloadable))
44void f(constant int *arg) { }
Egor Churaev28f00aa2016-12-23 16:11:25 +000045// ASMANG: @_Z1fPU3AS2i
David Tweed31d09b02013-09-13 12:04:22 +000046// NOASMANG: @_Z1fPU10CLconstanti
Egor Churaev28f00aa2016-12-23 16:11:25 +000047// OCL-20-DAG: @_Z1fPU3AS2i
48// OCL-12-DAG: @_Z1fPU3AS2i
Yaxun Liub7318e02017-10-13 03:37:48 +000049
50#if __OPENCL_C_VERSION__ >= 200
51__attribute__((overloadable))
52void f(generic int *arg) { }
53// ASMANG20: @_Z1fPU3AS4i
54// NOASMANG20: @_Z1fPU9CLgenerici
55// OCL-20-DAG: @_Z1fPU3AS4i
56#endif