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

Unified Diff: test/NaCl/Bitcode/null.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/Bitcode/no-structs.ll ('k') | test/NaCl/Bitcode/pnacl-bcdis/alloca.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/NaCl/Bitcode/null.ll
diff --git a/test/NaCl/Bitcode/null.ll b/test/NaCl/Bitcode/null.ll
new file mode 100644
index 0000000000000000000000000000000000000000..866c2017bfad1dc06e3f2f9a9ad6190c4da9db8e
--- /dev/null
+++ b/test/NaCl/Bitcode/null.ll
@@ -0,0 +1,82 @@
+; Test that we no longer generate NULL for numeric constants.
+
+; RUN: llvm-as < %s | pnacl-freeze \
+; RUN: | pnacl-bcanalyzer -dump-records \
+; RUN: | FileCheck %s -check-prefix=PF
+
+; RUN: llvm-as < %s | pnacl-freeze | pnacl-thaw \
+; RUN: | llvm-dis - | FileCheck %s -check-prefix=TD
+
+; ------------------------------------------------------
+
+define void @TestIntegers() {
+ %1 = and i1 true, false
+ %2 = add i8 1, 0
+ %3 = add i16 1, 0
+ %4 = add i32 1, 0
+ %5 = add i64 1, 0
+ ret void
+}
+
+; TD: define void @TestIntegers() {
+; TD-NEXT: %1 = and i1 true, false
+; TD-NEXT: %2 = add i8 1, 0
+; TD-NEXT: %3 = add i16 1, 0
+; TD-NEXT: %4 = add i32 1, 0
+; TD-NEXT: %5 = add i64 1, 0
+; TD-NEXT: ret void
+; TD-NEXT: }
+
+; PF: <FUNCTION_BLOCK>
+; PF-NEXT: <DECLAREBLOCKS op0=1/>
+; PF-NEXT: <CONSTANTS_BLOCK>
+; PF-NEXT: <SETTYPE op0=1/>
+; PF-NEXT: <INTEGER op0=3/>
+; PF-NEXT: <INTEGER op0=0/>
+; PF-NEXT: <SETTYPE op0=2/>
+; PF-NEXT: <INTEGER op0=2/>
+; PF-NEXT: <INTEGER op0=0/>
+; PF-NEXT: <SETTYPE op0=3/>
+; PF-NEXT: <INTEGER op0=2/>
+; PF-NEXT: <INTEGER op0=0/>
+; PF-NEXT: <SETTYPE op0=4/>
+; PF-NEXT: <INTEGER op0=2/>
+; PF-NEXT: <INTEGER op0=0/>
+; PF-NEXT: <SETTYPE op0=5/>
+; PF-NEXT: <INTEGER op0=2/>
+; PF-NEXT: <INTEGER op0=0/>
+; PF-NEXT: </CONSTANTS_BLOCK>
+; PF-NEXT: <INST_BINOP op0=10 op1=9 op2=10/>
+; PF-NEXT: <INST_BINOP op0=9 op1=8 op2=0/>
+; PF-NEXT: <INST_BINOP op0=8 op1=7 op2=0/>
+; PF-NEXT: <INST_BINOP op0=7 op1=6 op2=0/>
+; PF-NEXT: <INST_BINOP op0=6 op1=5 op2=0/>
+; PF-NEXT: <INST_RET/>
+; PF-NEXT: </FUNCTION_BLOCK>
+
+define void @TestFloats() {
+ %1 = fadd float 1.0, 0.0
+ %2 = fadd double 1.0, 0.0
+ ret void
+}
+
+; TD: define void @TestFloats() {
+; TD-NEXT: %1 = fadd float 1.000000e+00, 0.000000e+00
+; TD-NEXT: %2 = fadd double 1.000000e+00, 0.000000e+00
+; TD-NEXT: ret void
+; TD-NEXT: }
+
+; PF: <FUNCTION_BLOCK>
+; PF-NEXT: <DECLAREBLOCKS op0=1/>
+; PF-NEXT: <CONSTANTS_BLOCK>
+; PF-NEXT: <SETTYPE op0=6/>
+; PF-NEXT: <FLOAT op0=1065353216/>
+; PF-NEXT: <FLOAT op0=0/>
+; PF-NEXT: <SETTYPE op0=7/>
+; PF-NEXT: <FLOAT op0=4607182418800017408/>
+; PF-NEXT: <FLOAT op0=0/>
+; PF-NEXT: </CONSTANTS_BLOCK>
+; PF-NEXT: <INST_BINOP op0=4 op1=3 op2=0/>
+; PF-NEXT: <INST_BINOP op0=3 op1=2 op2=0/>
+; PF-NEXT: <INST_RET/>
+; PF-NEXT: </FUNCTION_BLOCK>
« no previous file with comments | « test/NaCl/Bitcode/no-structs.ll ('k') | test/NaCl/Bitcode/pnacl-bcdis/alloca.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698