Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(520)

Unified Diff: test/NaCl/PNaClABI/abi-small-arguments.ll

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/NaCl/PNaClABI/abi-metadata.ll ('k') | test/NaCl/PNaClABI/abi-stripped-pointers.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/NaCl/PNaClABI/abi-small-arguments.ll
diff --git a/test/NaCl/PNaClABI/abi-small-arguments.ll b/test/NaCl/PNaClABI/abi-small-arguments.ll
new file mode 100644
index 0000000000000000000000000000000000000000..696fac16b8c85e189198cc0efe02ddf026d00251
--- /dev/null
+++ b/test/NaCl/PNaClABI/abi-small-arguments.ll
@@ -0,0 +1,52 @@
+; RUN: not pnacl-abicheck < %s | FileCheck %s
+
+define void @arg_i1(i1 %bad) {
+ ret void
+}
+; CHECK: Function arg_i1 has disallowed type:
+
+define void @arg_i16(i32 %allowed, i16 %bad) {
+ ret void
+}
+; CHECK: Function arg_i16 has disallowed type:
+
+define i1 @return_i1() {
+ ret i1 0
+}
+; CHECK: Function return_i1 has disallowed type:
+
+define i8 @return_i8() {
+ ret i8 0
+}
+; CHECK: Function return_i8 has disallowed type:
+
+
+define void @bad_direct_calls() {
+ call void @arg_i1(i1 0)
+; CHECK: bad function callee operand: call void @arg_i1
+
+ call void @arg_i16(i32 0, i16 0)
+; CHECK-NEXT: bad function callee operand: call void @arg_i16
+
+ %result1 = call i1 @return_i1()
+; CHECK-NEXT: bad function callee operand: {{.*}} call i1 @return_i1
+
+ %result2 = call i8 @return_i8()
+; CHECK-NEXT: bad function callee operand: {{.*}} call i8 @return_i8
+
+ ret void
+}
+
+define void @bad_indirect_calls(i32 %ptr) {
+ %func1 = inttoptr i32 %ptr to void (i8)*
+; CHECK: bad result type: void (i8)* %func1
+ call void %func1(i8 0)
+; CHECK: bad function callee operand: {{.*}} %func1
+
+ %func2 = inttoptr i32 %ptr to i16 ()*
+; CHECK: bad result type: i16 ()* %func2
+ %result3 = call i16 %func2()
+; CHECK: bad function callee operand: {{.*}} %func2
+
+ ret void
+}
« no previous file with comments | « test/NaCl/PNaClABI/abi-metadata.ll ('k') | test/NaCl/PNaClABI/abi-stripped-pointers.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698