| Daniel Sanders | 18b68e1 | 2014-05-22 11:55:04 +0000 | [diff] [blame^] | 1 | ; RUN: llc < %s -march=mipsel | FileCheck %s -check-prefix=ALL -check-prefix=CHECK-EL |
| 2 | ; RUN: llc < %s -march=mips | FileCheck %s -check-prefix=ALL -check-prefix=CHECK-EB |
| Akira Hatanaka | 2fcc1cf | 2011-08-12 21:30:06 +0000 | [diff] [blame] | 3 | %struct.S2 = type { %struct.S1, %struct.S1 } |
| 4 | %struct.S1 = type { i8, i8 } |
| Akira Hatanaka | fb4161a | 2011-08-18 23:39:37 +0000 | [diff] [blame] | 5 | %struct.S4 = type { [7 x i8] } |
| Akira Hatanaka | 2fcc1cf | 2011-08-12 21:30:06 +0000 | [diff] [blame] | 6 | |
| 7 | @s2 = common global %struct.S2 zeroinitializer, align 1 |
| Akira Hatanaka | fb4161a | 2011-08-18 23:39:37 +0000 | [diff] [blame] | 8 | @s4 = common global %struct.S4 zeroinitializer, align 1 |
| Akira Hatanaka | 2fcc1cf | 2011-08-12 21:30:06 +0000 | [diff] [blame] | 9 | |
| Daniel Sanders | 18b68e1 | 2014-05-22 11:55:04 +0000 | [diff] [blame^] | 10 | define void @bar1() nounwind { |
| Akira Hatanaka | 2fcc1cf | 2011-08-12 21:30:06 +0000 | [diff] [blame] | 11 | entry: |
| Daniel Sanders | 18b68e1 | 2014-05-22 11:55:04 +0000 | [diff] [blame^] | 12 | ; ALL-LABEL: bar1: |
| Akira Hatanaka | fb4161a | 2011-08-18 23:39:37 +0000 | [diff] [blame] | 13 | |
| Daniel Sanders | 18b68e1 | 2014-05-22 11:55:04 +0000 | [diff] [blame^] | 14 | ; ALL-DAG: lw $[[R0:[0-9]+]], %got(s2)( |
| 15 | |
| 16 | ; ALL-DAG: lbu $[[PART1:[0-9]+]], 2($[[R0]]) |
| 17 | ; ALL-DAG: lbu $[[PART2:[0-9]+]], 3($[[R0]]) |
| 18 | |
| 19 | ; CHECK-EL-DAG: sll $[[T0:[0-9]+]], $[[PART2]], 8 |
| 20 | ; CHECK-EL-DAG: or $4, $[[T0]], $[[PART1]] |
| 21 | |
| 22 | ; CHECK-EB-DAG: sll $[[T0:[0-9]+]], $[[PART1]], 8 |
| 23 | ; CHECK-EB-DAG: or $[[T1:[0-9]+]], $[[T0]], $[[PART2]] |
| 24 | ; CHECK-EB-DAG: sll $4, $[[T1]], 16 |
| Akira Hatanaka | 2fcc1cf | 2011-08-12 21:30:06 +0000 | [diff] [blame] | 25 | |
| 26 | tail call void @foo2(%struct.S1* byval getelementptr inbounds (%struct.S2* @s2, i32 0, i32 1)) nounwind |
| Daniel Sanders | 18b68e1 | 2014-05-22 11:55:04 +0000 | [diff] [blame^] | 27 | ret void |
| 28 | } |
| 29 | |
| 30 | define void @bar2() nounwind { |
| 31 | entry: |
| 32 | ; ALL-LABEL: bar2: |
| 33 | |
| 34 | ; ALL-DAG: lw $[[R2:[0-9]+]], %got(s4)( |
| 35 | |
| 36 | ; CHECK-EL-DAG: lwl $[[R1:4]], 3($[[R2]]) |
| 37 | ; CHECK-EL-DAG: lwr $[[R1]], 0($[[R2]]) |
| 38 | |
| 39 | ; CHECK-EB-DAG: lwl $[[R1:4]], 0($[[R2]]) |
| 40 | ; CHECK-EB-DAG: lwr $[[R1]], 3($[[R2]]) |
| 41 | |
| Akira Hatanaka | fb4161a | 2011-08-18 23:39:37 +0000 | [diff] [blame] | 42 | tail call void @foo4(%struct.S4* byval @s4) nounwind |
| Akira Hatanaka | 2fcc1cf | 2011-08-12 21:30:06 +0000 | [diff] [blame] | 43 | ret void |
| 44 | } |
| 45 | |
| 46 | declare void @foo2(%struct.S1* byval) |
| Akira Hatanaka | fb4161a | 2011-08-18 23:39:37 +0000 | [diff] [blame] | 47 | |
| 48 | declare void @foo4(%struct.S4* byval) |