OLD | NEW |
1 ; RUIN: %llvm2ice -verbose inst %s | FileCheck %s | 1 ; RUIN: %llvm2ice -verbose inst %s | FileCheck %s |
2 ; RUIN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s | 2 ; RUIN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s |
3 ; RUN: %szdiff --llvm2ice=%llvm2ice %s | FileCheck --check-prefix=DUMP %s | 3 ; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s |
4 | 4 |
5 @intern_global = global i32 12, align 4 | 5 ; Note: We don't run this test using a PNaCl bitcode file, because |
6 @extern_global = external global i32 | 6 ; external globals are not in the PNaCl ABI. |
| 7 |
| 8 @intern_global = global [4 x i8] [i8 0, i8 0, i8 0, i8 12], align 4 |
| 9 @extern_global = external global [4 x i8] |
7 | 10 |
8 define i32 @test_intern_global() { | 11 define i32 @test_intern_global() { |
9 ; CHECK: define i32 @test_intern_global | 12 ; CHECK: define i32 @test_intern_global |
10 entry: | 13 entry: |
11 %v0 = load i32* @intern_global, align 1 | 14 %__1 = bitcast [4 x i8]* @intern_global to i32* |
| 15 %v0 = load i32* %__1, align 1 |
12 ret i32 %v0 | 16 ret i32 %v0 |
13 } | 17 } |
14 | 18 |
15 define i32 @test_extern_global() { | 19 define i32 @test_extern_global() { |
16 ; CHECK: define i32 @test_extern_global | 20 ; CHECK: define i32 @test_extern_global |
17 entry: | 21 entry: |
18 %v0 = load i32* @extern_global, align 1 | 22 %__1 = bitcast [4 x i8]* @extern_global to i32* |
| 23 %v0 = load i32* %__1, align 1 |
19 ret i32 %v0 | 24 ret i32 %v0 |
20 } | 25 } |
21 | 26 |
22 ; ERRORS-NOT: ICE translation error | 27 ; ERRORS-NOT: ICE translation error |
23 ; DUMP-NOT: SZ | 28 ; DUMP-NOT: SZ |
OLD | NEW |