Hans Wennborg | c9bd88e | 2014-01-14 19:35:09 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=yes -triple %itanium_abi_triple -emit-llvm -o - | FileCheck -check-prefix=ASMANG %s |
| 2 | // RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=no -triple %itanium_abi_triple -emit-llvm -o - | FileCheck -check-prefix=NOASMANG %s |
David Tweed | 31d09b0 | 2013-09-13 12:04:22 +0000 | [diff] [blame] | 3 | |
Alexey Bader | a60db59 | 2016-12-07 08:43:49 +0000 | [diff] [blame^] | 4 | // We check that the address spaces are mangled the same in both version of OpenCL |
| 5 | // RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL2.0 -emit-llvm -o - | FileCheck -check-prefix=OCL-20 %s |
| 6 | // RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL1.2 -emit-llvm -o - | FileCheck -check-prefix=OCL-12 %s |
| 7 | |
David Tweed | 31d09b0 | 2013-09-13 12:04:22 +0000 | [diff] [blame] | 8 | // We can't name this f as private is equivalent to default |
| 9 | // no specifier given address space so we get multiple definition |
| 10 | // warnings, but we do want it for comparison purposes. |
| 11 | __attribute__((overloadable)) |
| 12 | void ff(int *arg) { } |
| 13 | // ASMANG: @_Z2ffPi |
| 14 | // NOASMANG: @_Z2ffPi |
Alexey Bader | a60db59 | 2016-12-07 08:43:49 +0000 | [diff] [blame^] | 15 | // OCL-20-DAG: @_Z2ffPU3AS4i |
| 16 | // OCL-12-DAG: @_Z2ffPi |
David Tweed | 31d09b0 | 2013-09-13 12:04:22 +0000 | [diff] [blame] | 17 | |
| 18 | __attribute__((overloadable)) |
| 19 | void f(private int *arg) { } |
| 20 | // ASMANG: @_Z1fPi |
| 21 | // NOASMANG: @_Z1fPi |
Alexey Bader | a60db59 | 2016-12-07 08:43:49 +0000 | [diff] [blame^] | 22 | // OCL-20-DAG: @_Z1fPi |
| 23 | // OCL-12-DAG: @_Z1fPi |
David Tweed | 31d09b0 | 2013-09-13 12:04:22 +0000 | [diff] [blame] | 24 | |
| 25 | __attribute__((overloadable)) |
| 26 | void f(global int *arg) { } |
| 27 | // ASMANG: @_Z1fPU3AS1i |
| 28 | // NOASMANG: @_Z1fPU8CLglobali |
Alexey Bader | a60db59 | 2016-12-07 08:43:49 +0000 | [diff] [blame^] | 29 | // OCL-20-DAG: @_Z1fPU3AS1i |
| 30 | // OCL-12-DAG: @_Z1fPU3AS1i |
David Tweed | 31d09b0 | 2013-09-13 12:04:22 +0000 | [diff] [blame] | 31 | |
| 32 | __attribute__((overloadable)) |
| 33 | void f(local int *arg) { } |
| 34 | // ASMANG: @_Z1fPU3AS2i |
| 35 | // NOASMANG: @_Z1fPU7CLlocali |
Alexey Bader | a60db59 | 2016-12-07 08:43:49 +0000 | [diff] [blame^] | 36 | // OCL-20-DAG: @_Z1fPU3AS2i |
| 37 | // OCL-12-DAG: @_Z1fPU3AS2i |
David Tweed | 31d09b0 | 2013-09-13 12:04:22 +0000 | [diff] [blame] | 38 | |
| 39 | __attribute__((overloadable)) |
| 40 | void f(constant int *arg) { } |
| 41 | // ASMANG: @_Z1fPU3AS3i |
| 42 | // NOASMANG: @_Z1fPU10CLconstanti |
Alexey Bader | a60db59 | 2016-12-07 08:43:49 +0000 | [diff] [blame^] | 43 | // OCL-20-DAG: @_Z1fPU3AS3i |
| 44 | // OCL-12-DAG: @_Z1fPU3AS3i |