Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 ; Trivial test of the use of internal versus external global | 1 ; Trivial test of the use of internal versus external global |
| 2 ; variables. | 2 ; variables. |
| 3 | 3 |
| 4 ; TODO(kschimpf) find out why lc2i is needed. | 4 ; TODO(kschimpf) find out why lc2i is needed. |
| 5 ; RUN: %lc2i -i %s --args --verbose inst | FileCheck %s | 5 ; RUN: %lc2i -i %s --args --verbose inst | FileCheck %s |
|
jvoung (off chromium)
2014/10/07 15:35:31
Does removing the external, or having this new mod
Karl
2014/10/07 15:56:22
The reason this test was failing to work in p2i wa
| |
| 6 ; RUN: %lc2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s | 6 ; RUN: %lc2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s |
| 7 | 7 |
| 8 ; Note: PNaCl ABI Doesn't allow external globals. Hence, not tested. | |
| 8 @intern_global = internal global [4 x i8] c"\00\00\00\0C", align 4 | 9 @intern_global = internal global [4 x i8] c"\00\00\00\0C", align 4 |
| 9 @extern_global = external global [4 x i8] | |
| 10 | 10 |
| 11 define i32 @test_intern_global() { | 11 define i32 @test_intern_global() { |
| 12 ; CHECK: define i32 @test_intern_global | 12 ; CHECK: define i32 @test_intern_global |
| 13 entry: | 13 entry: |
| 14 %__1 = bitcast [4 x i8]* @intern_global to i32* | 14 %__1 = bitcast [4 x i8]* @intern_global to i32* |
| 15 %v0 = load i32* %__1, align 1 | 15 %v0 = load i32* %__1, align 1 |
| 16 ret i32 %v0 | 16 ret i32 %v0 |
| 17 } | 17 } |
| 18 | 18 |
| 19 define i32 @test_extern_global() { | |
| 20 ; CHECK: define i32 @test_extern_global | |
| 21 entry: | |
| 22 %__1 = bitcast [4 x i8]* @extern_global to i32* | |
| 23 %v0 = load i32* %__1, align 1 | |
| 24 ret i32 %v0 | |
| 25 } | |
| 26 | |
| 27 ; ERRORS-NOT: ICE translation error | 19 ; ERRORS-NOT: ICE translation error |
| OLD | NEW |