1*67e74705SXin Li // RUN: %clang -target mipsel-unknown-linux -S -o - -emit-llvm %s \
2*67e74705SXin Li // RUN: | FileCheck %s
3*67e74705SXin Li
4*67e74705SXin Li // This checks that the frontend will accept inline asm operand modifiers
5*67e74705SXin Li
6*67e74705SXin Li int printf(const char*, ...);
7*67e74705SXin Li
8*67e74705SXin Li typedef int v4i32 __attribute__((vector_size(16)));
9*67e74705SXin Li
10*67e74705SXin Li // CHECK: %{{[0-9]+}} = call i32 asm ".set noreorder;\0Alw $0,$1;\0A.set reorder;\0A", "=r,*m,~{$1}"(i32* getelementptr inbounds ([8 x i32], [8 x i32]* @b, i32 {{[0-9]+}}, i32 {{[0-9]+}})) #2,
11*67e74705SXin Li // CHECK: %{{[0-9]+}} = call i32 asm "lw $0,${1:D};\0A", "=r,*m,~{$1}"(i32* getelementptr inbounds ([8 x i32], [8 x i32]* @b, i32 {{[0-9]+}}, i32 {{[0-9]+}})) #2,
12*67e74705SXin Li // CHECK: %{{[0-9]+}} = call <4 x i32> asm "ldi.w ${0:w},1", "=f,~{$1}"
13*67e74705SXin Li int b[8] = {0,1,2,3,4,5,6,7};
main()14*67e74705SXin Li int main()
15*67e74705SXin Li {
16*67e74705SXin Li int i;
17*67e74705SXin Li v4i32 v4i32_r;
18*67e74705SXin Li
19*67e74705SXin Li // The first word. Notice, no 'D'
20*67e74705SXin Li {asm (
21*67e74705SXin Li ".set noreorder;\n"
22*67e74705SXin Li "lw %0,%1;\n"
23*67e74705SXin Li ".set reorder;\n"
24*67e74705SXin Li : "=r" (i)
25*67e74705SXin Li : "m" (*(b+4)));}
26*67e74705SXin Li
27*67e74705SXin Li printf("%d\n",i);
28*67e74705SXin Li
29*67e74705SXin Li // The second word
30*67e74705SXin Li {asm (
31*67e74705SXin Li "lw %0,%D1;\n"
32*67e74705SXin Li : "=r" (i)
33*67e74705SXin Li : "m" (*(b+4))
34*67e74705SXin Li );}
35*67e74705SXin Li
36*67e74705SXin Li // MSA registers
37*67e74705SXin Li {asm ("ldi.w %w0,1" : "=f" (v4i32_r));}
38*67e74705SXin Li
39*67e74705SXin Li printf("%d\n",i);
40*67e74705SXin Li
41*67e74705SXin Li return 1;
42*67e74705SXin Li }
43