minix/external/bsd/llvm/dist/clang/test/CodeGenCUDA/filter-decl.cu
Lionel Sambuc f4a2713ac8 Importing netbsd clang -- pristine
Change-Id: Ia40e9ffdf29b5dab2f122f673ff6802a58bc690f
2014-07-28 17:05:57 +02:00

40 lines
1.3 KiB
Text

// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-HOST %s
// RUN: %clang_cc1 -emit-llvm %s -o - -fcuda-is-device | FileCheck -check-prefix=CHECK-DEVICE %s
#include "../SemaCUDA/cuda.h"
// CHECK-HOST-NOT: constantdata = global
// CHECK-DEVICE: constantdata = global
__constant__ char constantdata[256];
// CHECK-HOST-NOT: devicedata = global
// CHECK-DEVICE: devicedata = global
__device__ char devicedata[256];
// CHECK-HOST-NOT: shareddata = global
// CHECK-DEVICE: shareddata = global
__shared__ char shareddata[256];
// CHECK-HOST: hostdata = global
// CHECK-DEVICE-NOT: hostdata = global
char hostdata[256];
// CHECK-HOST: define{{.*}}implicithostonlyfunc
// CHECK-DEVICE-NOT: define{{.*}}implicithostonlyfunc
void implicithostonlyfunc(void) {}
// CHECK-HOST: define{{.*}}explicithostonlyfunc
// CHECK-DEVICE-NOT: define{{.*}}explicithostonlyfunc
__host__ void explicithostonlyfunc(void) {}
// CHECK-HOST-NOT: define{{.*}}deviceonlyfunc
// CHECK-DEVICE: define{{.*}}deviceonlyfunc
__device__ void deviceonlyfunc(void) {}
// CHECK-HOST: define{{.*}}hostdevicefunc
// CHECK-DEVICE: define{{.*}}hostdevicefunc
__host__ __device__ void hostdevicefunc(void) {}
// CHECK-HOST: define{{.*}}globalfunc
// CHECK-DEVICE: define{{.*}}globalfunc
__global__ void globalfunc(void) {}