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

Unified Diff: test/NaCl/PNaClABI/types-function.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/types.ll ('k') | test/NaCl/PNaClLLC/lit.local.cfg » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/NaCl/PNaClABI/types-function.ll
diff --git a/test/NaCl/PNaClABI/types-function.ll b/test/NaCl/PNaClABI/types-function.ll
new file mode 100644
index 0000000000000000000000000000000000000000..4aa6f276fd99ca19304c5b337eb373f0aa139c85
--- /dev/null
+++ b/test/NaCl/PNaClABI/types-function.ll
@@ -0,0 +1,40 @@
+; RUN: not pnacl-abicheck < %s | FileCheck %s
+; Test type-checking in function bodies. This test is not intended to verify
+; all the rules about the various types, but instead to make sure that types
+; stashed in various places in function bodies are caught.
+
+@a2 = private global i17 zeroinitializer
+
+; CHECK: Function func has disallowed type: void (i15)
+declare void @func(i15 %arg)
+
+!llvm.foo = !{!0}
+!0 = metadata !{ half 0.0}
+
+define void @types() {
+; CHECK: bad result type: {{.*}} fptrunc
+ %h1 = fptrunc double undef to half
+
+; CHECK: bad operand: {{.*}} bitcast half
+ %h2 = bitcast half 0.0 to i16
+
+; see below...
+ %h3 = fadd double 0.0, fpext (half 0.0 to double)
+
+; CHECK: bad pointer: store
+ store i32 0, i32* bitcast (i17* @a2 to i32*), align 1
+
+; CHECK: bad function callee operand: call void @func(i15 1)
+ call void @func(i15 1)
+
+; CHECK: Function types has disallowed instruction metadata: !foo
+ ret void, !foo !0
+}
+; CHECK-NOT: disallowed
+
+
+; TODO:
+; the bitcode reader seems to expand some operations inline
+; (e.g. fpext, sext, uitofp) such that doing something like
+; %h3 = fadd double 0.0, fpext (half 0.0 to double)
+; means the verifier pass will never see the fpext or its operands
« no previous file with comments | « test/NaCl/PNaClABI/types.ll ('k') | test/NaCl/PNaClLLC/lit.local.cfg » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698