summaryrefslogtreecommitdiff
path: root/test/Index
diff options
context:
space:
mode:
authorEli Bendersky <eliben@google.com>2014-05-28 19:29:58 +0000
committerEli Bendersky <eliben@google.com>2014-05-28 19:29:58 +0000
commitf722606af2c9dbc2d24705254bdf89bcc48a7a79 (patch)
tree72f97592f114a162b4d7b7954c278114b83e4958 /test/Index
parent5ff1d8a32b03cd24659fccae6eca1700193bdcbc (diff)
downloadclang-f722606af2c9dbc2d24705254bdf89bcc48a7a79.tar.gz
Expose CUDA function attributes to the C interface.
Until now all CUDA-specific attributes were represented with CXCursor_UnexposedAttr; now they are actually implemented, including the Python bindings. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209767 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Index')
-rw-r--r--test/Index/attributes-cuda.cu16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Index/attributes-cuda.cu b/test/Index/attributes-cuda.cu
new file mode 100644
index 0000000000..e0023a1366
--- /dev/null
+++ b/test/Index/attributes-cuda.cu
@@ -0,0 +1,16 @@
+// RUN: c-index-test -test-load-source all -x cuda %s | FileCheck %s
+
+__attribute__((device)) void f_device();
+__attribute__((global)) void f_global();
+__attribute__((constant)) int* g_constant;
+__attribute__((host)) void f_host();
+
+
+// CHECK: attributes-cuda.cu:3:30: FunctionDecl=f_device:3:30
+// CHECK-NEXT: attributes-cuda.cu:3:16: attribute(device)
+// CHECK: attributes-cuda.cu:4:30: FunctionDecl=f_global:4:30
+// CHECK-NEXT: attributes-cuda.cu:4:16: attribute(global)
+// CHECK: attributes-cuda.cu:5:32: VarDecl=g_constant:5:32 (Definition)
+// CHECK-NEXT: attributes-cuda.cu:5:16: attribute(constant)
+// CHECK: attributes-cuda.cu:6:28: FunctionDecl=f_host:6:28
+// CHECK-NEXT: attributes-cuda.cu:6:16: attribute(host)