1 ; Positive test for inline register constraints
3 ; RUN: llc -march=mipsel -mcpu=mips32 < %s | FileCheck %s
4 ; RUN: llc -march=mipsel -mcpu=mips32r2 < %s | FileCheck %s
6 define i32 @main() nounwind {
11 ;CHECK: addiu ${{[0-9]+}}, ${{[0-9]+}}, 23
13 tail call i8 asm sideeffect "addiu $0, $1, $2", "=r,r,n"(i8 27, i8 23) nounwind
17 ;CHECK: addiu ${{[0-9]+}}, ${{[0-9]+}}, 13
19 tail call i16 asm sideeffect "addiu $0, $1, $2", "=r,r,n"(i16 17, i16 13) nounwind
23 ;CHECK: addiu ${{[0-9]+}}, ${{[0-9]+}}, 3
25 tail call i32 asm sideeffect "addiu $0, $1, $2", "=r,r,n"(i32 7, i32 3) nounwind
27 ; Now c with 1024: make sure register $25 is picked
29 ; CHECK: addiu $25, ${{[0-9]+}}, 1024
31 tail call i32 asm sideeffect "addiu $0, $1, $2", "=c,c,I"(i32 4194304, i32 1024) nounwind
33 ; Now l with 1024: make sure register lo is picked. We do this by checking the instruction
34 ; after the inline expression for a mflo to pull the value out of lo.
36 ; CHECK: mtlo ${{[0-9]+}}
37 ; CHECK-NEXT: madd ${{[0-9]+}}, ${{[0-9]+}}
39 ; CHECK-NEXT: mflo ${{[0-9]+}}
40 %bosco = alloca i32, align 4
41 call i32 asm sideeffect "\09mtlo $3 \0A\09\09madd $1, $2 ", "=l,r,r,r"(i32 7, i32 6, i32 44) nounwind
42 store volatile i32 %4, i32* %bosco, align 4
44 ; Check the 'l' constraint for 16-bit type.
46 ; CHECK: mtlo ${{[0-9]+}}
47 ; CHECK-NEXT: madd ${{[0-9]+}}, ${{[0-9]+}}
49 ; CHECK-NEXT: mflo ${{[0-9]+}}
50 %bosco16 = alloca i16, align 4
51 call i16 asm sideeffect "\09mtlo $3 \0A\09\09madd $1, $2 ", "=l,r,r,r"(i32 7, i32 6, i32 44) nounwind
52 store volatile i16 %5, i16* %bosco16, align 4