Akira Hatanaka | 3309dba | 2012-06-02 01:13:10 +0000 | [diff] [blame] | 1 | ; RUN: llc -march=mipsel < %s | FileCheck -check-prefix=EL %s |
| 2 | ; RUN: llc -march=mips < %s | FileCheck -check-prefix=EB %s |
| 3 | |
| 4 | %struct.SI = type { i32 } |
| 5 | |
| 6 | @si = common global %struct.SI zeroinitializer, align 1 |
| 7 | |
| 8 | define i32 @foo_load_i() nounwind readonly { |
| 9 | entry: |
| 10 | ; EL: lwl $[[R0:[0-9]+]], 3($[[R1:[0-9]+]]) |
| 11 | ; EL: lwr $[[R0]], 0($[[R1]]) |
| 12 | ; EB: lwl $[[R0:[0-9]+]], 0($[[R1:[0-9]+]]) |
| 13 | ; EB: lwr $[[R0]], 3($[[R1]]) |
| 14 | |
| 15 | %0 = load i32* getelementptr inbounds (%struct.SI* @si, i32 0, i32 0), align 1 |
| 16 | ret i32 %0 |
| 17 | } |
| 18 | |
| 19 | define void @foo_store_i(i32 %a) nounwind { |
| 20 | entry: |
| 21 | ; EL: swl $[[R0:[0-9]+]], 3($[[R1:[0-9]+]]) |
| 22 | ; EL: swr $[[R0]], 0($[[R1]]) |
| 23 | ; EB: swl $[[R0:[0-9]+]], 0($[[R1:[0-9]+]]) |
| 24 | ; EB: swr $[[R0]], 3($[[R1]]) |
| 25 | |
| 26 | store i32 %a, i32* getelementptr inbounds (%struct.SI* @si, i32 0, i32 0), align 1 |
| 27 | ret void |
| 28 | } |
| 29 | |