1926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// RUN: %clang_cc1 -triple i686 %s -emit-llvm -o - | FileCheck %s
2926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// RUN: %clang_cc1 -triple x86_64 %s -emit-llvm -o - | FileCheck %s
3926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// RUN: %clang_cc1 -triple arm %s -emit-llvm -o - | FileCheck %s
4926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// RUN: %clang_cc1 -triple mips %s -emit-llvm -o - | FileCheck %s
5926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// RUN: %clang_cc1 -triple mipsel %s -emit-llvm -o - | FileCheck %s
6926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// RUN: %clang_cc1 -triple powerpc %s -emit-llvm -o - | FileCheck %s
7926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// RUN: %clang_cc1 -triple powerpc64 %s -emit-llvm -o - | FileCheck %s
8b8409215523e5478b8b0aa9cdcd10038cf7651feUlrich Weigand// RUN: %clang_cc1 -triple s390x %s -emit-llvm -o - | FileCheck %s
9926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// RUN: %clang_cc1 -triple sparc %s -emit-llvm -o - | FileCheck %s
1056e1f1f7abda394b81a5df7f75d3c6e0a570d6c0Jakob Stoklund Olesen// RUN: %clang_cc1 -triple sparcv9 %s -emit-llvm -o - | FileCheck %s
11926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// RUN: %clang_cc1 -triple thumb %s -emit-llvm -o - | FileCheck %s
12926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
13926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonint mout0;
14926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonint min1;
15926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonint marray[2];
16926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
17926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @single_m
18926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid single_m()
19926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
200e2c34f92f00628d48968dfea096d36381f494cbStephen Hines  // CHECK: call void asm "foo $1,$0", "=*m,*m[[CLOBBERS:[a-zA-Z0-9@%{},~_$ ]*\"]](i32* {{[a-zA-Z0-9@%]+}}, i32* {{[a-zA-Z0-9@%]+}})
21926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=m" (mout0) : "m" (min1));
22926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
23926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
24926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @single_o
25926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid single_o()
26926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
27926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int out0 = 0;
28926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int index = 1;
29926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // Doesn't really do an offset...
30926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  //asm("foo %1, %2,%0" : "=r" (out0) : "o" (min1));
31926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
32926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
33926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @single_V
34926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid single_V()
35926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
36926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson//  asm("foo %1,%0" : "=m" (mout0) : "V" (min1));
37926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
38926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
39926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @single_lt
40926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid single_lt()
41926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
42926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int out0 = 0;
43926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int in1 = 1;
44926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r,<r[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
45926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r" (out0) : "<r" (in1));
46926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r,r<[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
47926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r" (out0) : "r<" (in1));
48926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
49926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
50926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @single_gt
51926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid single_gt()
52926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
53926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int out0 = 0;
54926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int in1 = 1;
55926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r,>r[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
56926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r" (out0) : ">r" (in1));
57926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r,r>[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
58926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r" (out0) : "r>" (in1));
59926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
60926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
61926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @single_r
62926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid single_r()
63926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
64926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int out0 = 0;
65926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int in1 = 1;
66926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r,r[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
67926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r" (out0) : "r" (in1));
68926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
69926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
70926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @single_i
71926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid single_i()
72926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
73926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int out0 = 0;
74926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r,i[[CLOBBERS]](i32 1)
75926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r" (out0) : "i" (1));
76926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
77926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
78926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @single_n
79926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid single_n()
80926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
81926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int out0 = 0;
82926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r,n[[CLOBBERS]](i32 1)
83926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r" (out0) : "n" (1));
84926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
85926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
86926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @single_E
87926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid single_E()
88926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
89926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register double out0 = 0.0;
90926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call double asm "foo $1,$0", "=r,E[[CLOBBERS]](double {{[0-9.eE+-]+}})
91926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r" (out0) : "E" (1.0e+01));
92926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
93926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
94926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @single_F
95926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid single_F()
96926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
97926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register double out0 = 0.0;
98926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call double asm "foo $1,$0", "=r,F[[CLOBBERS]](double {{[0-9.eE+-]+}})
99926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r" (out0) : "F" (1.0));
100926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
101926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
102926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @single_s
103926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid single_s()
104926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
105926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int out0 = 0;
106926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  //asm("foo %1,%0" : "=r" (out0) : "s" (single_s));
107926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
108926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
109926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @single_g
110926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid single_g()
111926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
112926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int out0 = 0;
113926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int in1 = 1;
114926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r,imr[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
115926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r" (out0) : "g" (in1));
116926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r,imr[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
117926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r" (out0) : "g" (min1));
118926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r,imr[[CLOBBERS]](i32 1)
119926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r" (out0) : "g" (1));
120926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
121926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
122926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @single_X
123926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid single_X()
124926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
125926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int out0 = 0;
126926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int in1 = 1;
127926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r,X[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
128926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r" (out0) : "X" (in1));
129926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r,X[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
130926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r" (out0) : "X" (min1));
131926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r,X[[CLOBBERS]](i32 1)
132926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r" (out0) : "X" (1));
1333ea9e33ea25e0c2b12db56418ba3f994eb662c04Pirama Arumuga Nainar  // CHECK: call i32 asm "foo $1,$0", "=r,X[[CLOBBERS]](i32* getelementptr inbounds ([2 x i32], [2 x i32]* {{[a-zA-Z0-9@%]+}}, i32 0, i32 0))
134926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r" (out0) : "X" (marray));
135926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r,X[[CLOBBERS]](double {{[0-9.eE+-]+}})
136926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r" (out0) : "X" (1.0e+01));
137926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r,X[[CLOBBERS]](double {{[0-9.eE+-]+}})
138926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r" (out0) : "X" (1.0));
139926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
140926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
141926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @single_p
142926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid single_p()
143926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
144926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int out0 = 0;
145926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // Constraint converted differently on different platforms moved to platform-specific.
1463ea9e33ea25e0c2b12db56418ba3f994eb662c04Pirama Arumuga Nainar  // : call i32 asm "foo $1,$0", "=r,im[[CLOBBERS]](i32* getelementptr inbounds ([2 x i32], [2 x i32]* {{[a-zA-Z0-9@%]+}}, i32 0, i32 0))
147926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r" (out0) : "p" (marray));
148926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
149926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
150926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @multi_m
151926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid multi_m()
152926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
153926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call void asm "foo $1,$0", "=*m|r,m|r[[CLOBBERS]](i32* {{[a-zA-Z0-9@%]+}}, i32 {{[a-zA-Z0-9@%]+}})
154926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=m,r" (mout0) : "m,r" (min1));
155926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
156926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
157926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @multi_o
158926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid multi_o()
159926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
160926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int out0 = 0;
161926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int index = 1;
162926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // Doesn't really do an offset...
163926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  //asm("foo %1, %2,%0" : "=r,r" (out0) : "r,o" (min1));
164926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
165926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
166926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @multi_V
167926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid multi_V()
168926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
169926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson//  asm("foo %1,%0" : "=m,r" (mout0) : "r,V" (min1));
170926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
171926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
172926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @multi_lt
173926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid multi_lt()
174926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
175926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int out0 = 0;
176926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int in1 = 1;
177926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r|r,r|<r[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
178926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r,r" (out0) : "r,<r" (in1));
179926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r|r,r|r<[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
180926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r,r" (out0) : "r,r<" (in1));
181926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
182926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
183926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @multi_gt
184926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid multi_gt()
185926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
186926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int out0 = 0;
187926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int in1 = 1;
188926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r|r,r|>r[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
189926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r,r" (out0) : "r,>r" (in1));
190926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r|r,r|r>[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
191926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r,r" (out0) : "r,r>" (in1));
192926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
193926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
194926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @multi_r
195926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid multi_r()
196926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
197926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int out0 = 0;
198926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int in1 = 1;
199926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r|r,r|m[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
200926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r,r" (out0) : "r,m" (in1));
201926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
202926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
203926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @multi_i
204926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid multi_i()
205926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
206926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int out0 = 0;
207926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r|r,r|i[[CLOBBERS]](i32 1)
208926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r,r" (out0) : "r,i" (1));
209926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
210926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
211926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @multi_n
212926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid multi_n()
213926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
214926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int out0 = 0;
215926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r|r,r|n[[CLOBBERS]](i32 1)
216926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r,r" (out0) : "r,n" (1));
217926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
218926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
219926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @multi_E
220926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid multi_E()
221926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
222926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register double out0 = 0.0;
223926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call double asm "foo $1,$0", "=r|r,r|E[[CLOBBERS]](double {{[0-9.eE+-]+}})
224926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r,r" (out0) : "r,E" (1.0e+01));
225926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
226926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
227926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @multi_F
228926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid multi_F()
229926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
230926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register double out0 = 0.0;
231926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call double asm "foo $1,$0", "=r|r,r|F[[CLOBBERS]](double {{[0-9.eE+-]+}})
232926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r,r" (out0) : "r,F" (1.0));
233926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
234926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
235926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @multi_s
236926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid multi_s()
237926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
238926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int out0 = 0;
239926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  //asm("foo %1,%0" : "=r,r" (out0) : "r,s" (multi_s));
240926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
241926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
242926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @multi_g
243926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid multi_g()
244926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
245926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int out0 = 0;
246926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int in1 = 1;
247926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r|r,r|imr[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
248926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r,r" (out0) : "r,g" (in1));
249926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r|r,r|imr[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
250926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r,r" (out0) : "r,g" (min1));
251926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r|r,r|imr[[CLOBBERS]](i32 1)
252926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r,r" (out0) : "r,g" (1));
253926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
254926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
255926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @multi_X
256926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid multi_X()
257926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
258926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int out0 = 0;
259926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int in1 = 1;
260926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r|r,r|X[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
261926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r,r" (out0) : "r,X" (in1));
262926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r|r,r|X[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
263926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r,r" (out0) : "r,X" (min1));
264926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r|r,r|X[[CLOBBERS]](i32 1)
265926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r,r" (out0) : "r,X" (1));
2663ea9e33ea25e0c2b12db56418ba3f994eb662c04Pirama Arumuga Nainar  // CHECK: call i32 asm "foo $1,$0", "=r|r,r|X[[CLOBBERS]](i32* getelementptr inbounds ([2 x i32], [2 x i32]* {{[a-zA-Z0-9@%]+}}, i32 0, i32 0))
267926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r,r" (out0) : "r,X" (marray));
268926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r|r,r|X[[CLOBBERS]](double {{[0-9.eE+-]+}})
269926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r,r" (out0) : "r,X" (1.0e+01));
270926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // CHECK: call i32 asm "foo $1,$0", "=r|r,r|X[[CLOBBERS]](double {{[0-9.eE+-]+}})
271926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r,r" (out0) : "r,X" (1.0));
272926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
273926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson
274926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson// CHECK: @multi_p
275926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompsonvoid multi_p()
276926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson{
277926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  register int out0 = 0;
278926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  // Constraint converted differently on different platforms moved to platform-specific.
2793ea9e33ea25e0c2b12db56418ba3f994eb662c04Pirama Arumuga Nainar  // : call i32 asm "foo $1,$0", "=r|r,r|im[[CLOBBERS]](i32* getelementptr inbounds ([2 x i32], [2 x i32]* {{[a-zA-Z0-9@%]+}}, i32 0, i32 0))
280926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson  asm("foo %1,%0" : "=r,r" (out0) : "r,p" (marray));
281926ee13e1061c351f948a39d3a2ee86d590dfc67John Thompson}
282