2019-01-31 23:23:48 +08:00
|
|
|
// 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
|
|
|
|
// 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
|
|
|
|
// 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
|
|
|
|
// 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
|
2021-12-13 23:43:37 +08:00
|
|
|
// 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
|
|
|
|
// 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
|
2013-09-13 20:04:22 +08:00
|
|
|
|
2016-12-07 16:43:49 +08:00
|
|
|
// We check that the address spaces are mangled the same in both version of OpenCL
|
|
|
|
// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL2.0 -emit-llvm -o - | FileCheck -check-prefix=OCL-20 %s
|
|
|
|
// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL1.2 -emit-llvm -o - | FileCheck -check-prefix=OCL-12 %s
|
2021-12-13 23:43:37 +08:00
|
|
|
// 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
|
|
|
|
// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL3.0 -cl-ext=-all -emit-llvm -o - | FileCheck -check-prefix=OCL-12 %s
|
|
|
|
// 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
|
|
|
|
// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++2021 -cl-ext=-all -emit-llvm -o - | FileCheck -check-prefix=OCL-12 %s
|
2016-12-07 16:43:49 +08:00
|
|
|
|
2013-09-13 20:04:22 +08:00
|
|
|
// We can't name this f as private is equivalent to default
|
|
|
|
// no specifier given address space so we get multiple definition
|
|
|
|
// warnings, but we do want it for comparison purposes.
|
|
|
|
__attribute__((overloadable))
|
|
|
|
void ff(int *arg) { }
|
2017-10-13 11:37:48 +08:00
|
|
|
// ASMANG10: @_Z2ffPi
|
|
|
|
// ASMANG20: @_Z2ffPU3AS4i
|
2019-01-31 23:23:48 +08:00
|
|
|
// NOASMANG10: @_Z2ffPU9CLprivatei
|
2017-10-13 11:37:48 +08:00
|
|
|
// NOASMANG20: @_Z2ffPU9CLgenerici
|
2016-12-07 16:43:49 +08:00
|
|
|
// OCL-20-DAG: @_Z2ffPU3AS4i
|
|
|
|
// OCL-12-DAG: @_Z2ffPi
|
2013-09-13 20:04:22 +08:00
|
|
|
|
|
|
|
__attribute__((overloadable))
|
|
|
|
void f(private int *arg) { }
|
|
|
|
// ASMANG: @_Z1fPi
|
2017-10-13 11:37:48 +08:00
|
|
|
// NOASMANG: @_Z1fPU9CLprivatei
|
2016-12-07 16:43:49 +08:00
|
|
|
// OCL-20-DAG: @_Z1fPi
|
|
|
|
// OCL-12-DAG: @_Z1fPi
|
2013-09-13 20:04:22 +08:00
|
|
|
|
|
|
|
__attribute__((overloadable))
|
|
|
|
void f(global int *arg) { }
|
|
|
|
// ASMANG: @_Z1fPU3AS1i
|
|
|
|
// NOASMANG: @_Z1fPU8CLglobali
|
2016-12-07 16:43:49 +08:00
|
|
|
// OCL-20-DAG: @_Z1fPU3AS1i
|
|
|
|
// OCL-12-DAG: @_Z1fPU3AS1i
|
2013-09-13 20:04:22 +08:00
|
|
|
|
|
|
|
__attribute__((overloadable))
|
|
|
|
void f(local int *arg) { }
|
2016-12-24 00:11:25 +08:00
|
|
|
// ASMANG: @_Z1fPU3AS3i
|
2013-09-13 20:04:22 +08:00
|
|
|
// NOASMANG: @_Z1fPU7CLlocali
|
2016-12-24 00:11:25 +08:00
|
|
|
// OCL-20-DAG: @_Z1fPU3AS3i
|
|
|
|
// OCL-12-DAG: @_Z1fPU3AS3i
|
2013-09-13 20:04:22 +08:00
|
|
|
|
|
|
|
__attribute__((overloadable))
|
|
|
|
void f(constant int *arg) { }
|
2016-12-24 00:11:25 +08:00
|
|
|
// ASMANG: @_Z1fPU3AS2i
|
2013-09-13 20:04:22 +08:00
|
|
|
// NOASMANG: @_Z1fPU10CLconstanti
|
2016-12-24 00:11:25 +08:00
|
|
|
// OCL-20-DAG: @_Z1fPU3AS2i
|
|
|
|
// OCL-12-DAG: @_Z1fPU3AS2i
|
2017-10-13 11:37:48 +08:00
|
|
|
|
2021-07-13 17:45:38 +08:00
|
|
|
#if (__OPENCL_C_VERSION__ == 200) || defined(__opencl_c_generic_address_space)
|
2017-10-13 11:37:48 +08:00
|
|
|
__attribute__((overloadable))
|
|
|
|
void f(generic int *arg) { }
|
|
|
|
// ASMANG20: @_Z1fPU3AS4i
|
|
|
|
// NOASMANG20: @_Z1fPU9CLgenerici
|
|
|
|
// OCL-20-DAG: @_Z1fPU3AS4i
|
|
|
|
#endif
|