Peter Collingbourne a9455ec9f8 CUDA: add -fcuda-is-device flag
This frontend-only flag is used by the IR generator to determine
whether to filter CUDA declarations for the host or for the device.

llvm-svn: 141301
2011-10-06 18:29:46 +00:00

13 lines
376 B
Plaintext

// RUN: %clang_cc1 %s -triple ptx32-unknown-unknown -fcuda-is-device -emit-llvm -o - | FileCheck %s
#include "../SemaCUDA/cuda.h"
// CHECK: define ptx_device{{.*}}device_function
__device__ void device_function() {}
// CHECK: define ptx_kernel{{.*}}global_function
__global__ void global_function() {
// CHECK: call ptx_device{{.*}}device_function
device_function();
}