Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 1 | ; Simple test of the store instruction. |
| 2 | |
Karl Schimpf | 2a5324a | 2014-09-25 09:37:49 -0700 | [diff] [blame^] | 3 | ; TODO(kschimpf) Find out why lc2i is needed, and fix. |
| 4 | ; RUN: %lc2i -i %s --args --verbose inst | FileCheck %s |
| 5 | ; RUN: %lc2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s |
| 6 | ; RUN: %lc2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s |
Jim Stichnoth | f7c9a14 | 2014-04-29 10:52:43 -0700 | [diff] [blame] | 7 | |
| 8 | define void @store_i64(i32 %addr_arg) { |
| 9 | entry: |
Karl Schimpf | a667fb8 | 2014-05-19 14:56:51 -0700 | [diff] [blame] | 10 | %__1 = inttoptr i32 %addr_arg to i64* |
| 11 | store i64 1, i64* %__1, align 1 |
Jim Stichnoth | f7c9a14 | 2014-04-29 10:52:43 -0700 | [diff] [blame] | 12 | ret void |
| 13 | |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 14 | ; CHECK: Initial CFG |
Karl Schimpf | a667fb8 | 2014-05-19 14:56:51 -0700 | [diff] [blame] | 15 | ; CHECK: %__1 = i32 %addr_arg |
Jim Stichnoth | f7c9a14 | 2014-04-29 10:52:43 -0700 | [diff] [blame] | 16 | ; CHECK-NEXT: store i64 1, {{.*}}, align 1 |
| 17 | ; CHECK-NEXT: ret void |
| 18 | } |
| 19 | |
| 20 | define void @store_i32(i32 %addr_arg) { |
| 21 | entry: |
Karl Schimpf | a667fb8 | 2014-05-19 14:56:51 -0700 | [diff] [blame] | 22 | %__1 = inttoptr i32 %addr_arg to i32* |
| 23 | store i32 1, i32* %__1, align 1 |
Jim Stichnoth | f7c9a14 | 2014-04-29 10:52:43 -0700 | [diff] [blame] | 24 | ret void |
| 25 | |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 26 | ; CHECK: Initial CFG |
Karl Schimpf | a667fb8 | 2014-05-19 14:56:51 -0700 | [diff] [blame] | 27 | ; CHECK: %__1 = i32 %addr_arg |
Jim Stichnoth | f7c9a14 | 2014-04-29 10:52:43 -0700 | [diff] [blame] | 28 | ; CHECK-NEXT: store i32 1, {{.*}}, align 1 |
| 29 | ; CHECK-NEXT: ret void |
| 30 | } |
| 31 | |
| 32 | define void @store_i16(i32 %addr_arg) { |
| 33 | entry: |
Karl Schimpf | a667fb8 | 2014-05-19 14:56:51 -0700 | [diff] [blame] | 34 | %__1 = inttoptr i32 %addr_arg to i16* |
| 35 | store i16 1, i16* %__1, align 1 |
Jim Stichnoth | f7c9a14 | 2014-04-29 10:52:43 -0700 | [diff] [blame] | 36 | ret void |
| 37 | |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 38 | ; CHECK: Initial CFG |
Karl Schimpf | a667fb8 | 2014-05-19 14:56:51 -0700 | [diff] [blame] | 39 | ; CHECK: %__1 = i32 %addr_arg |
Jim Stichnoth | f7c9a14 | 2014-04-29 10:52:43 -0700 | [diff] [blame] | 40 | ; CHECK-NEXT: store i16 1, {{.*}}, align 1 |
| 41 | ; CHECK-NEXT: ret void |
| 42 | } |
| 43 | |
| 44 | define void @store_i8(i32 %addr_arg) { |
| 45 | entry: |
Karl Schimpf | a667fb8 | 2014-05-19 14:56:51 -0700 | [diff] [blame] | 46 | %__1 = inttoptr i32 %addr_arg to i8* |
| 47 | store i8 1, i8* %__1, align 1 |
Jim Stichnoth | f7c9a14 | 2014-04-29 10:52:43 -0700 | [diff] [blame] | 48 | ret void |
| 49 | |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 50 | ; CHECK: Initial CFG |
Karl Schimpf | a667fb8 | 2014-05-19 14:56:51 -0700 | [diff] [blame] | 51 | ; CHECK: %__1 = i32 %addr_arg |
Jim Stichnoth | f7c9a14 | 2014-04-29 10:52:43 -0700 | [diff] [blame] | 52 | ; CHECK-NEXT: store i8 1, {{.*}}, align 1 |
| 53 | ; CHECK-NEXT: ret void |
| 54 | } |
| 55 | |
| 56 | ; ERRORS-NOT: ICE translation error |
| 57 | ; DUMP-NOT: SZ |