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