Index: test/NaCl/PNaClABI/abi-externals-whitelist.ll |
diff --git a/test/NaCl/PNaClABI/abi-externals-whitelist.ll b/test/NaCl/PNaClABI/abi-externals-whitelist.ll |
new file mode 100644 |
index 0000000000000000000000000000000000000000..bdb95968041160baf33d9f9aff917b696b27da9f |
--- /dev/null |
+++ b/test/NaCl/PNaClABI/abi-externals-whitelist.ll |
@@ -0,0 +1,28 @@ |
+; RUN: not pnacl-abicheck < %s | FileCheck %s |
+ |
+; Make sure that external symbols are properly rejected or accepted |
+ |
+ |
+@global_var = global [4 x i8] c"abcd" |
+; CHECK: global_var is not a valid external symbol (disallowed) |
+ |
+ |
+define void @foo() { |
+ ret void |
+} |
+; CHECK: foo is not a valid external symbol (disallowed) |
+ |
+define external void @main() { |
+ ret void |
+} |
+; CHECK: main is not a valid external symbol (disallowed) |
+ |
+define external void @_start() { |
+ ret void |
+} |
+; _start is whitelisted |
+; CHECK-NOT: disallowed |
+ |
+; Intrinsics can be external too |
+declare void @llvm.trap() |
+ |