OLD | NEW |
(Empty) | |
| 1 ; Tests that even though global variables can define structured types, |
| 2 ; they types are not put into the bitcode file. |
| 3 |
| 4 ; RUN: llvm-as < %s | pnacl-freeze \ |
| 5 ; RUN: | pnacl-bcanalyzer -dump-records \ |
| 6 ; RUN: | FileCheck %s -check-prefix=PF2 |
| 7 |
| 8 declare void @func() |
| 9 |
| 10 @compound = internal global <{ [4 x i8], i32 }> |
| 11 <{ [4 x i8] c"home", i32 ptrtoint (void ()* @func to i32) }> |
| 12 |
| 13 define void @CheckBitcastGlobal() { |
| 14 %1 = bitcast <{ [4 x i8], i32}>* @compound to i32* |
| 15 %2 = load i32* %1, align 4 |
| 16 ret void |
| 17 } |
| 18 |
| 19 define void @CheckPtrToIntGlobal() { |
| 20 %1 = ptrtoint <{ [4 x i8], i32 }>* @compound to i32 |
| 21 %2 = add i32 %1, 0 |
| 22 ret void |
| 23 } |
| 24 |
| 25 ; Note that it doesn't define a struct type. |
| 26 |
| 27 ; PF2: <TYPE_BLOCK_ID> |
| 28 ; PF2-NEXT: <NUMENTRY op0=3/> |
| 29 ; PF2-NEXT: <INTEGER op0=32/> |
| 30 ; PF2-NEXT: <VOID/> |
| 31 ; PF2-NEXT: <FUNCTION op0=0 op1=1/> |
| 32 ; PF2-NEXT: </TYPE_BLOCK_ID> |
OLD | NEW |