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

Unified Diff: test/NaCl/Bitcode/no-structs.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/lit.local.cfg ('k') | test/NaCl/Bitcode/null.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/NaCl/Bitcode/no-structs.ll
diff --git a/test/NaCl/Bitcode/no-structs.ll b/test/NaCl/Bitcode/no-structs.ll
new file mode 100644
index 0000000000000000000000000000000000000000..289cc119fb6d5b22d92d5aa6b2f1f03f6f4c83ba
--- /dev/null
+++ b/test/NaCl/Bitcode/no-structs.ll
@@ -0,0 +1,32 @@
+; Tests that even though global variables can define structured types,
+; they types are not put into the bitcode file.
+
+; RUN: llvm-as < %s | pnacl-freeze \
+; RUN: | pnacl-bcanalyzer -dump-records \
+; RUN: | FileCheck %s -check-prefix=PF2
+
+declare void @func()
+
+@compound = internal global <{ [4 x i8], i32 }>
+ <{ [4 x i8] c"home", i32 ptrtoint (void ()* @func to i32) }>
+
+define void @CheckBitcastGlobal() {
+ %1 = bitcast <{ [4 x i8], i32}>* @compound to i32*
+ %2 = load i32* %1, align 4
+ ret void
+}
+
+define void @CheckPtrToIntGlobal() {
+ %1 = ptrtoint <{ [4 x i8], i32 }>* @compound to i32
+ %2 = add i32 %1, 0
+ ret void
+}
+
+; Note that it doesn't define a struct type.
+
+; PF2: <TYPE_BLOCK_ID>
+; PF2-NEXT: <NUMENTRY op0=3/>
+; PF2-NEXT: <INTEGER op0=32/>
+; PF2-NEXT: <VOID/>
+; PF2-NEXT: <FUNCTION op0=0 op1=1/>
+; PF2-NEXT: </TYPE_BLOCK_ID>
« no previous file with comments | « test/NaCl/Bitcode/lit.local.cfg ('k') | test/NaCl/Bitcode/null.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698