OLD | NEW |
1 ; RUN: pnacl-llc -O2 -mtriple=x86_64-none-nacl < %s | \ | 1 ; RUN: pnacl-llc -O2 -mtriple=x86_64-none-nacl < %s | \ |
2 ; RUN: FileCheck %s --check-prefix=NACLON | 2 ; RUN: FileCheck %s --check-prefix=NACLON |
3 ; RUN: pnacl-llc -O2 -mtriple=x86_64-linux < %s | \ | 3 ; RUN: pnacl-llc -O2 -mtriple=x86_64-linux < %s | \ |
4 ; RUN: FileCheck %s --check-prefix=NACLOFF | 4 ; RUN: FileCheck %s --check-prefix=NACLOFF |
5 | 5 |
6 ; This test is derived from the following C code: | 6 ; This test is derived from the following C code: |
7 ; | 7 ; |
8 ; int myglobal[100]; | 8 ; int myglobal[100]; |
9 ; void test(int arg) | 9 ; void test(int arg) |
10 ; { | 10 ; { |
(...skipping 19 matching lines...) Expand all Loading... |
30 @myglobal = global [100 x i32] zeroinitializer, align 4 | 30 @myglobal = global [100 x i32] zeroinitializer, align 4 |
31 | 31 |
32 define void @test(i32 %arg) #0 { | 32 define void @test(i32 %arg) #0 { |
33 entry: | 33 entry: |
34 ; NACLON: test: | 34 ; NACLON: test: |
35 ; NACLON-NOT: mov{{.*}}nacl:myglobal( | 35 ; NACLON-NOT: mov{{.*}}nacl:myglobal( |
36 ; NACLOFF: test: | 36 ; NACLOFF: test: |
37 ; NACLOFF: mov{{.*}}myglobal( | 37 ; NACLOFF: mov{{.*}}myglobal( |
38 %arg.addr = alloca i32, align 4 | 38 %arg.addr = alloca i32, align 4 |
39 store i32 %arg, i32* %arg.addr, align 4 | 39 store i32 %arg, i32* %arg.addr, align 4 |
40 %0 = load i32* %arg.addr, align 4 | 40 %0 = load i32, i32* %arg.addr, align 4 |
41 %1 = load i32* %arg.addr, align 4 | 41 %1 = load i32, i32* %arg.addr, align 4 |
42 %arrayidx = getelementptr inbounds [100 x i32]* @myglobal, i32 0, i32 %1 | 42 %arrayidx = getelementptr inbounds [100 x i32], [100 x i32]* @myglobal, i32 0,
i32 %1 |
43 store i32 %0, i32* %arrayidx, align 4 | 43 store i32 %0, i32* %arrayidx, align 4 |
44 %2 = load i32* %arg.addr, align 4 | 44 %2 = load i32, i32* %arg.addr, align 4 |
45 %3 = load i32* %arg.addr, align 4 | 45 %3 = load i32, i32* %arg.addr, align 4 |
46 %add = add nsw i32 %3, 1 | 46 %add = add nsw i32 %3, 1 |
47 %arrayidx1 = getelementptr inbounds [100 x i32]* @myglobal, i32 0, i32 %add | 47 %arrayidx1 = getelementptr inbounds [100 x i32], [100 x i32]* @myglobal, i32 0
, i32 %add |
48 store i32 %2, i32* %arrayidx1, align 4 | 48 store i32 %2, i32* %arrayidx1, align 4 |
49 ret void | 49 ret void |
50 } | 50 } |
OLD | NEW |