aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenOpenCL/address-spaces.cl
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenOpenCL/address-spaces.cl')
-rw-r--r--test/CodeGenOpenCL/address-spaces.cl27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/CodeGenOpenCL/address-spaces.cl b/test/CodeGenOpenCL/address-spaces.cl
new file mode 100644
index 000000000000..e030c77d3e01
--- /dev/null
+++ b/test/CodeGenOpenCL/address-spaces.cl
@@ -0,0 +1,27 @@
+// RUN: %clang_cc1 %s -ffake-address-space-map -emit-llvm -o - | FileCheck %s
+
+void f__p(__private int *arg) { }
+// CHECK: i32* nocapture %arg
+
+void f__g(__global int *arg) { }
+// CHECK: i32 addrspace(1)* nocapture %arg
+
+void f__l(__local int *arg) { }
+// CHECK: i32 addrspace(2)* nocapture %arg
+
+void f__c(__constant int *arg) { }
+// CHECK: i32 addrspace(3)* nocapture %arg
+
+
+void fp(private int *arg) { }
+// CHECK: i32* nocapture %arg
+
+void fg(global int *arg) { }
+// CHECK: i32 addrspace(1)* nocapture %arg
+
+void fl(local int *arg) { }
+// CHECK: i32 addrspace(2)* nocapture %arg
+
+void fc(constant int *arg) { }
+// CHECK: i32 addrspace(3)* nocapture %arg
+