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

Unified Diff: test/NaCl/Bitcode/forward-ref-pointer-intrinsic.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/forward-ref-decl.ll ('k') | test/NaCl/Bitcode/globalvars.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/NaCl/Bitcode/forward-ref-pointer-intrinsic.ll
diff --git a/test/NaCl/Bitcode/forward-ref-pointer-intrinsic.ll b/test/NaCl/Bitcode/forward-ref-pointer-intrinsic.ll
new file mode 100644
index 0000000000000000000000000000000000000000..ccb88ecd82a450e8fd10994ef3d76f686528b6a3
--- /dev/null
+++ b/test/NaCl/Bitcode/forward-ref-pointer-intrinsic.ll
@@ -0,0 +1,32 @@
+; Test forward reference of a pointer-typed intrinsic result.
+
+; RUN: llvm-as < %s | pnacl-freeze -allow-local-symbol-tables \
+; RUN: | pnacl-thaw -allow-local-symbol-tables \
+; RUN: | llvm-dis - | FileCheck %s -check-prefix=TD2
+
+declare i8* @llvm.nacl.read.tp()
+
+define i32 @forward_ref() {
+ br label %block1
+
+block2:
+ %1 = load i8* %3
+ %2 = ptrtoint i8* %3 to i32
+ ret i32 %2
+
+block1:
+ %3 = call i8* @llvm.nacl.read.tp()
+ br label %block2
+}
+
+; TD2: define i32 @forward_ref() {
+; TD2-NEXT: br label %block1
+; TD2: block2:
+; TD2-NEXT: %1 = inttoptr i32 %4 to i8*
+; TD2-NEXT: %2 = load i8* %1
+; TD2-NEXT: ret i32 %4
+; TD2: block1:
+; TD2-NEXT: %3 = call i8* @llvm.nacl.read.tp()
+; TD2-NEXT: %4 = ptrtoint i8* %3 to i32
+; TD2-NEXT: br label %block2
+; TD2-NEXT: }
« no previous file with comments | « test/NaCl/Bitcode/forward-ref-decl.ll ('k') | test/NaCl/Bitcode/globalvars.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698