blob: 51f4aedd198d06514e6f3c2a7a1a69a0cab42e5b [file] [log] [blame]
Aaron Ballmana670c202014-05-29 16:39:42 +00001// RUN: c-index-test -test-load-source all -x cuda %s | FileCheck %s
Artem Belevich0ff05cd2015-07-13 23:27:56 +00002// RUN: c-index-test -test-load-source all -x cuda --cuda-host-only %s | FileCheck %s
3// RUN: c-index-test -test-load-source all -x cuda --cuda-device-only %s | FileCheck %s
Eli Bendersky2581e662014-05-28 19:29:58 +00004
5__attribute__((device)) void f_device();
6__attribute__((global)) void f_global();
7__attribute__((constant)) int* g_constant;
Eli Bendersky9b071472014-08-08 14:59:00 +00008__attribute__((shared)) float *g_shared;
Eli Bendersky2581e662014-05-28 19:29:58 +00009__attribute__((host)) void f_host();
10
Artem Belevich0ff05cd2015-07-13 23:27:56 +000011// CHECK: attributes-cuda.cu:5:30: FunctionDecl=f_device:5:30
12// CHECK-NEXT: attributes-cuda.cu:5:16: attribute(device)
13// CHECK: attributes-cuda.cu:6:30: FunctionDecl=f_global:6:30
14// CHECK-NEXT: attributes-cuda.cu:6:16: attribute(global)
15// CHECK: attributes-cuda.cu:7:32: VarDecl=g_constant:7:32 (Definition)
16// CHECK-NEXT: attributes-cuda.cu:7:16: attribute(constant)
17// CHECK: attributes-cuda.cu:8:32: VarDecl=g_shared:8:32 (Definition)
18// CHECK-NEXT: attributes-cuda.cu:8:16: attribute(shared)
19// CHECK: attributes-cuda.cu:9:28: FunctionDecl=f_host:9:28
20// CHECK-NEXT: attributes-cuda.cu:9:16: attribute(host)