47 lines · plain
1// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-HOST %s2// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o - -fcuda-is-device | FileCheck -check-prefix=CHECK-DEVICE %s3 4#include "Inputs/cuda.h"5 6// This has to be at the top of the file as that's where file-scope7// asm ends up.8// CHECK-HOST: module asm "file scope asm is host only"9// CHECK-DEVICE-NOT: module asm "file scope asm is host only"10__asm__("file scope asm is host only");11 12// CHECK-HOST: constantdata = internal global13// CHECK-DEVICE: constantdata = {{(dso_local )?}}externally_initialized constant14__constant__ char constantdata[256];15 16// CHECK-HOST: devicedata = internal global17// CHECK-DEVICE: devicedata = {{(dso_local )?}}externally_initialized global18__device__ char devicedata[256];19 20// CHECK-HOST: shareddata = internal global21// CHECK-DEVICE: shareddata = {{(dso_local )?}}global22__shared__ char shareddata[256];23 24// CHECK-HOST: hostdata = {{(dso_local )?}}global25// CHECK-DEVICE-NOT: hostdata = global26char hostdata[256];27 28// CHECK-HOST: define{{.*}}implicithostonlyfunc29// CHECK-DEVICE-NOT: define{{.*}}implicithostonlyfunc30void implicithostonlyfunc(void) {}31 32// CHECK-HOST: define{{.*}}explicithostonlyfunc33// CHECK-DEVICE-NOT: define{{.*}}explicithostonlyfunc34__host__ void explicithostonlyfunc(void) {}35 36// CHECK-HOST-NOT: define{{.*}}deviceonlyfunc37// CHECK-DEVICE: define{{.*}}deviceonlyfunc38__device__ void deviceonlyfunc(void) {}39 40// CHECK-HOST: define{{.*}}hostdevicefunc41// CHECK-DEVICE: define{{.*}}hostdevicefunc42__host__ __device__ void hostdevicefunc(void) {}43 44// CHECK-HOST: define{{.*}}globalfunc45// CHECK-DEVICE: define{{.*}}globalfunc46__global__ void globalfunc(void) {}47