Home | History | Annotate | Download | only in CodeGenCUDA
      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
      3 
      4 #include "Inputs/cuda.h"
      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) {}
     41