OLD | NEW |
(Empty) | |
| 1 ; Checks if llvm bitcode defines a struct type before the pointer type, |
| 2 ; even if the struct definintion appears after the pointer type, while |
| 3 ; pnacl bitcode moves the pointer before the struct. |
| 4 ; RUN: llvm-as < %s | llvm-bcanalyzer -dump | FileCheck %s -check-prefix=LLVM |
| 5 ; RUN: llvm-as < %s | pnacl-freeze | pnacl-bcanalyzer -dump | FileCheck %s -chec
k-prefix=PNACL |
| 6 |
| 7 %typeB = type { i8, %typeA, i32, %typeA } |
| 8 %typeA = type { i16 } |
| 9 |
| 10 define %typeB* @foo(%typeB* %a) { |
| 11 ret %typeB* %a |
| 12 } |
| 13 |
| 14 define %typeB* @bar(%typeB* %b) { |
| 15 ret %typeB* %b |
| 16 } |
| 17 |
| 18 define i16 @bam(i16 %a) { |
| 19 ret i16 %a |
| 20 } |
| 21 |
| 22 ; Show the ordering llvm uses to order types, which is to expand subtypes |
| 23 ; (including accross pointers) before the type. Expands types for functions |
| 24 ; in order: @foo, @bar, @bam. |
| 25 ; LLVM: <TYPE_BLOCK_ID {{.*}}> |
| 26 ; i8 |
| 27 ; LLVM: <INTEGER op0=8/> |
| 28 ; i16 |
| 29 ; LLVM: <INTEGER op0=16/> |
| 30 ; %typeA = type { i16 } |
| 31 ; LLVM: <STRUCT_NAME abbrevid=7 op0=116 op1=121 op2=112 op3=101 op4=65/> |
| 32 ; LLVM: <STRUCT_NAMED abbrevid=8 op0=0 op1=1/> |
| 33 ; i32 |
| 34 ; LLVM: <INTEGER op0=32/> |
| 35 ; %typeB = type { i8, %typeA, i32, %typeA } |
| 36 ; LLVM: <STRUCT_NAME abbrevid=7 op0=116 op1=121 op2=112 op3=101 op4=66/> |
| 37 ; LLVM: <STRUCT_NAMED abbrevid=8 op0=0 op1=0 op2=2 op3=3 op4=2/> |
| 38 ; %typeB* |
| 39 ; LLVM: <POINTER abbrevid=4 op0=4 op1=0/> |
| 40 ; %typeB* (%typeB*) |
| 41 ; LLVM: <FUNCTION abbrevid=5 op0=0 op1=5 op2=5/> |
| 42 ; %typeB* (%typeB*)* |
| 43 ; LLVM: <POINTER abbrevid=4 op0=6 op1=0/> |
| 44 ; i16 (i16) |
| 45 ; LLVM: <FUNCTION abbrevid=5 op0=0 op1=1 op2=1/> |
| 46 ; i16 (i16)* |
| 47 ; LLVM: <POINTER abbrevid=4 op0=8 op1=0/> |
| 48 ; type of instruction "RET" |
| 49 ; LLVM: <VOID/> |
| 50 ; LLVM: </TYPE_BLOCK_ID> |
| 51 |
| 52 ; Show the ordering pnacl-freeze uses to order types. |
| 53 ; PNACL: <TYPE_BLOCK_ID {{.*}}> |
| 54 ; %typeB* |
| 55 ; PNACL: <POINTER abbrevid=4 op0=8 op1=0/> |
| 56 ; i16 |
| 57 ; PNACL: <INTEGER op0=16/> |
| 58 ; type of instruction "RET" |
| 59 ; PNACL: <VOID/> |
| 60 ; %typeA = type { i16 } |
| 61 ; PNACL: <STRUCT_NAME abbrevid=7 op0=116 op1=121 op2=112 op3=101 op4=65/> |
| 62 ; PNACL: <STRUCT_NAMED abbrevid=8 op0=0 op1=1/> |
| 63 ; %typeB* (%typeB*) |
| 64 ; PNACL: <FUNCTION abbrevid=5 op0=0 op1=0 op2=0/> |
| 65 ; %typeB* (%typeB*)* |
| 66 ; PNACL: <POINTER abbrevid=4 op0=4 op1=0/> |
| 67 ; i8 |
| 68 ; PNACL: <INTEGER op0=8/> |
| 69 ; i32 |
| 70 ; PNACL: <INTEGER op0=32/> |
| 71 ; %typeB = type { i8, %typeA, i32, %typeA } |
| 72 ; PNACL: <STRUCT_NAME abbrevid=7 op0=116 op1=121 op2=112 op3=101 op4=66/> |
| 73 ; PNACL: <STRUCT_NAMED abbrevid=8 op0=0 op1=6 op2=3 op3=7 op4=3/> |
| 74 ; i16 (i16) |
| 75 ; PNACL: <FUNCTION abbrevid=5 op0=0 op1=1 op2=1/> |
| 76 ; i16 (i16)* |
| 77 ; PNACL: <POINTER abbrevid=4 op0=9 op1=0/> |
| 78 ; PNACL: </TYPE_BLOCK_ID> |
OLD | NEW |