1 ; RUN: llc -march=mipsel < %s | FileCheck %s
4 @g1 = external global i32
6 define i32 @f1(i32 %x) nounwind {
10 ; CHECK: sw $4, [[OFFSET:[0-9]+]]($sp)
12 ; CHECK: lw $[[T1:[0-9]+]], %got(g1)
14 ; CHECK: lw $[[T3:[0-9]+]], [[OFFSET]]($sp)
16 ; CHECK: sw $[[T3]], 0($[[T1]])
18 %l1 = alloca i32, align 4
19 call void asm "sw $1, $0", "=*m,r"(i32* %l1, i32 %x) nounwind
20 %0 = call i32 asm "lw $0, $1", "=r,*m"(i32* %l1) nounwind
21 store i32 %0, i32* @g1, align 4
26 ; "D": Second word of a double word. This works for any memory element
29 ; CHECK: lw ${{[0-9]+}}, 16(${{[0-9]+}});
32 ; No "D": First word of a double word. This works for any memory element
35 ; CHECK: lw ${{[0-9]+}}, 12(${{[0-9]+}});
38 @b = common global [20 x i32] zeroinitializer, align 4
43 tail call void asm sideeffect " lw $0, ${1:D};", "r,*m,~{$11}"(i32 undef, i32* getelementptr inbounds ([20 x i32], [20 x i32]* @b, i32 0, i32 3))
44 ; First word. Notice, no 'D':
45 tail call void asm sideeffect " lw $0, ${1};", "r,*m,~{$11}"(i32 undef, i32* getelementptr inbounds ([20 x i32], [20 x i32]* @b, i32 0, i32 3))