Index: test/NaCl/PNaClABI/abi-addrspace.ll |
diff --git a/test/NaCl/PNaClABI/abi-addrspace.ll b/test/NaCl/PNaClABI/abi-addrspace.ll |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9a737b513a79ac430ee722232755095c5f2d999f |
--- /dev/null |
+++ b/test/NaCl/PNaClABI/abi-addrspace.ll |
@@ -0,0 +1,16 @@ |
+; RUN: not pnacl-abicheck < %s | FileCheck %s |
+ |
+; This test checks that the "addrspace" pointer attribute is rejected |
+; by the PNaCl ABI verifier. The only allowed address space value is |
+; 0 (the default). |
+ |
+@var = addrspace(1) global [4 x i8] c"xxxx" |
+; CHECK: Variable var has addrspace attribute (disallowed) |
+ |
+define void @func() { |
+ inttoptr i32 0 to i32 addrspace(2)* |
+; CHECK: disallowed: bad result type: {{.*}} inttoptr {{.*}} addrspace |
+ ret void |
+} |
+ |
+; CHECK-NOT: disallowed |