blob: 8d34f4f3a654c18973a35d595a076ae313e18fa3 [file] [log] [blame]
Justin Holewinski83e96682012-05-24 17:43:12 +00001// RUN: %clang_cc1 %s -triple nvptx-unknown-unknown -fcuda-is-device -emit-llvm -o - | FileCheck %s
Peter Collingbourne5bad4af2011-10-06 16:49:54 +00002
3#include "../SemaCUDA/cuda.h"
4
Justin Holewinski36837432013-03-30 14:38:24 +00005// CHECK: define void @device_function
6extern "C"
Peter Collingbourne5bad4af2011-10-06 16:49:54 +00007__device__ void device_function() {}
8
Justin Holewinski36837432013-03-30 14:38:24 +00009// CHECK: define void @global_function
10extern "C"
Peter Collingbourne5bad4af2011-10-06 16:49:54 +000011__global__ void global_function() {
Justin Holewinski36837432013-03-30 14:38:24 +000012 // CHECK: call void @device_function
Peter Collingbourne5bad4af2011-10-06 16:49:54 +000013 device_function();
14}
Justin Holewinski36837432013-03-30 14:38:24 +000015
16// CHECK: !{{[0-9]+}} = metadata !{void ()* @global_function, metadata !"kernel", i32 1}