[mips] Implement MipsTargetMachine::getInstrItineraryData().
[oota-llvm.git] / test / CodeGen / Mips / unalignedload.ll
1 ; RUN: llc  < %s -march=mipsel  | FileCheck %s -check-prefix=CHECK-EL
2 ; RUN: llc  < %s -march=mips    | FileCheck %s -check-prefix=CHECK-EB
3 %struct.S2 = type { %struct.S1, %struct.S1 }
4 %struct.S1 = type { i8, i8 }
5 %struct.S4 = type { [7 x i8] }
6
7 @s2 = common global %struct.S2 zeroinitializer, align 1
8 @s4 = common global %struct.S4 zeroinitializer, align 1
9
10 define void @foo1() nounwind {
11 entry:
12 ; CHECK-EL-DAG: lbu ${{[0-9]+}}, 2($[[R0:[0-9]+]])
13 ; CHECK-EL-DAG: lbu ${{[0-9]+}}, 3($[[R0]])
14 ; CHECK-EL:     jalr
15 ; CHECK-EL-DAG: lwl $[[R1:[0-9]+]], 3($[[R2:[0-9]+]])
16 ; CHECK-EL-DAG: lwr $[[R1]], 0($[[R2]])
17
18 ; CHECK-EB-DAG: lbu ${{[0-9]+}}, 3($[[R0:[0-9]+]])
19 ; CHECK-EB-DAG: lbu ${{[0-9]+}}, 2($[[R0]])
20 ; CHECK-EB:     jalr
21 ; CHECK-EB-DAG: lwl $[[R1:[0-9]+]], 0($[[R2:[0-9]+]])
22 ; CHECK-EB-DAG: lwr $[[R1]], 3($[[R2]])
23
24   tail call void @foo2(%struct.S1* byval getelementptr inbounds (%struct.S2* @s2, i32 0, i32 1)) nounwind
25   tail call void @foo4(%struct.S4* byval @s4) nounwind
26   ret void
27 }
28
29 declare void @foo2(%struct.S1* byval)
30
31 declare void @foo4(%struct.S4* byval)