2012-05-25 01:43:12 +08:00
|
|
|
// RUN: %clang_cc1 %s -triple nvptx-unknown-unknown -fcuda-is-device -emit-llvm -o - | FileCheck %s
|
2011-10-07 00:49:54 +08:00
|
|
|
|
2014-04-29 06:21:28 +08:00
|
|
|
#include "Inputs/cuda.h"
|
2011-10-07 00:49:54 +08:00
|
|
|
|
2013-08-15 14:47:53 +08:00
|
|
|
// CHECK-LABEL: define void @device_function
|
2013-03-30 22:38:24 +08:00
|
|
|
extern "C"
|
2011-10-07 00:49:54 +08:00
|
|
|
__device__ void device_function() {}
|
|
|
|
|
2013-08-15 14:47:53 +08:00
|
|
|
// CHECK-LABEL: define void @global_function
|
2013-03-30 22:38:24 +08:00
|
|
|
extern "C"
|
2011-10-07 00:49:54 +08:00
|
|
|
__global__ void global_function() {
|
2013-03-30 22:38:24 +08:00
|
|
|
// CHECK: call void @device_function
|
2011-10-07 00:49:54 +08:00
|
|
|
device_function();
|
|
|
|
}
|
2013-03-30 22:38:24 +08:00
|
|
|
|
|
|
|
// CHECK: !{{[0-9]+}} = metadata !{void ()* @global_function, metadata !"kernel", i32 1}
|