summaryrefslogtreecommitdiff
path: root/test/CodeGenOpenCL
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2012-07-11 23:02:10 +0000
committerTanya Lattner <tonic@nondot.org>2012-07-11 23:02:10 +0000
commit198871cc90375246d8692680467ff6e810edac36 (patch)
treee821320efb84a2c2ada94f9bec59c2413515f7ef /test/CodeGenOpenCL
parent8951067a2bc35fb2a535bc18432cb2d02a762b73 (diff)
downloadclang-198871cc90375246d8692680467ff6e810edac36.tar.gz
Add OpenCL metadata for kernel arg names. This output is controlled via a flag as noted in the OpenCL Spec.
Includes a test case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160092 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenOpenCL')
-rw-r--r--test/CodeGenOpenCL/kernel-arg-info.cl7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/CodeGenOpenCL/kernel-arg-info.cl b/test/CodeGenOpenCL/kernel-arg-info.cl
new file mode 100644
index 0000000000..9d52736a76
--- /dev/null
+++ b/test/CodeGenOpenCL/kernel-arg-info.cl
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 %s -cl-kernel-arg-info -emit-llvm -o - | FileCheck %s
+
+kernel void foo(int *X, int Y, int anotherArg) {
+ *X = Y + anotherArg;
+}
+
+// CHECK: metadata !{metadata !"kernel_arg_name", metadata !"X", metadata !"Y", metadata !"anotherArg"}