Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-HOST %s |
| 2 | // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o - -fcuda-is-device | FileCheck -check-prefix=CHECK-DEVICE %s |
Peter Collingbourne | d51e43a | 2011-10-06 18:29:46 +0000 | [diff] [blame] | 3 | |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 4 | #include "Inputs/cuda.h" |
Peter Collingbourne | d51e43a | 2011-10-06 18:29:46 +0000 | [diff] [blame] | 5 | |
| 6 | // CHECK-HOST-NOT: constantdata = global |
| 7 | // CHECK-DEVICE: constantdata = global |
| 8 | __constant__ char constantdata[256]; |
| 9 | |
| 10 | // CHECK-HOST-NOT: devicedata = global |
| 11 | // CHECK-DEVICE: devicedata = global |
| 12 | __device__ char devicedata[256]; |
| 13 | |
| 14 | // CHECK-HOST-NOT: shareddata = global |
| 15 | // CHECK-DEVICE: shareddata = global |
| 16 | __shared__ char shareddata[256]; |
| 17 | |
| 18 | // CHECK-HOST: hostdata = global |
| 19 | // CHECK-DEVICE-NOT: hostdata = global |
| 20 | char hostdata[256]; |
| 21 | |
| 22 | // CHECK-HOST: define{{.*}}implicithostonlyfunc |
| 23 | // CHECK-DEVICE-NOT: define{{.*}}implicithostonlyfunc |
| 24 | void implicithostonlyfunc(void) {} |
| 25 | |
| 26 | // CHECK-HOST: define{{.*}}explicithostonlyfunc |
| 27 | // CHECK-DEVICE-NOT: define{{.*}}explicithostonlyfunc |
| 28 | __host__ void explicithostonlyfunc(void) {} |
| 29 | |
| 30 | // CHECK-HOST-NOT: define{{.*}}deviceonlyfunc |
| 31 | // CHECK-DEVICE: define{{.*}}deviceonlyfunc |
| 32 | __device__ void deviceonlyfunc(void) {} |
| 33 | |
| 34 | // CHECK-HOST: define{{.*}}hostdevicefunc |
| 35 | // CHECK-DEVICE: define{{.*}}hostdevicefunc |
| 36 | __host__ __device__ void hostdevicefunc(void) {} |
| 37 | |
| 38 | // CHECK-HOST: define{{.*}}globalfunc |
| 39 | // CHECK-DEVICE: define{{.*}}globalfunc |
| 40 | __global__ void globalfunc(void) {} |