1 // REQUIRES: x86-64-registered-target 2 // RUN: %clang_cc1 %s -triple i386-apple-darwin10 -O0 -fasm-blocks -emit-llvm -o - | FileCheck %s 3 4 void t1() { 5 // CHECK: @t1 6 // CHECK: call void asm sideeffect inteldialect "", "~{dirflag},~{fpsr},~{flags}"() 7 // CHECK: ret void 8 __asm {} 9 } 10 11 void t2() { 12 // CHECK: @t2 13 // CHECK: call void asm sideeffect inteldialect "nop", "~{dirflag},~{fpsr},~{flags}"() 14 // CHECK: call void asm sideeffect inteldialect "nop", "~{dirflag},~{fpsr},~{flags}"() 15 // CHECK: call void asm sideeffect inteldialect "nop", "~{dirflag},~{fpsr},~{flags}"() 16 // CHECK: ret void 17 __asm nop 18 __asm nop 19 __asm nop 20 } 21 22 void t3() { 23 // CHECK: @t3 24 // CHECK: call void asm sideeffect inteldialect "nop\0A\09nop\0A\09nop", "~{dirflag},~{fpsr},~{flags}"() 25 // CHECK: ret void 26 __asm nop __asm nop __asm nop 27 } 28 29 void t4(void) { 30 // CHECK: @t4 31 // CHECK: call void asm sideeffect inteldialect "mov ebx, eax", "~{ebx},~{dirflag},~{fpsr},~{flags}"() 32 // CHECK: call void asm sideeffect inteldialect "mov ecx, ebx", "~{ecx},~{dirflag},~{fpsr},~{flags}"() 33 // CHECK: ret void 34 __asm mov ebx, eax 35 __asm mov ecx, ebx 36 } 37 38 void t5(void) { 39 // CHECK: @t5 40 // CHECK: call void asm sideeffect inteldialect "mov ebx, eax\0A\09mov ecx, ebx", "~{ebx},~{ecx},~{dirflag},~{fpsr},~{flags}"() 41 // CHECK: ret void 42 __asm mov ebx, eax __asm mov ecx, ebx 43 } 44 45 void t6(void) { 46 __asm int 0x2c 47 // CHECK: t6 48 // CHECK: call void asm sideeffect inteldialect "int $$0x2c", "~{dirflag},~{fpsr},~{flags}"() 49 } 50 51 void t7() { 52 __asm { 53 int 0x2c ; } asm comments are fun! }{ 54 } 55 __asm {} 56 // CHECK: t7 57 // CHECK: call void asm sideeffect inteldialect "int $$0x2c", "~{dirflag},~{fpsr},~{flags}"() 58 // CHECK: call void asm sideeffect inteldialect "", "~{dirflag},~{fpsr},~{flags}"() 59 } 60 61 int t8() { 62 __asm int 4 ; } comments for single-line asm 63 __asm {} 64 __asm int 4 65 return 10; 66 // CHECK: t8 67 // CHECK: call void asm sideeffect inteldialect "int $$4", "~{dirflag},~{fpsr},~{flags}"() 68 // CHECK: call void asm sideeffect inteldialect "", "~{dirflag},~{fpsr},~{flags}"() 69 // CHECK: call void asm sideeffect inteldialect "int $$4", "~{dirflag},~{fpsr},~{flags}"() 70 // CHECK: ret i32 10 71 } 72 73 void t9() { 74 __asm { 75 push ebx 76 mov ebx, 0x07 77 pop ebx 78 } 79 // CHECK: t9 80 // CHECK: call void asm sideeffect inteldialect "push ebx\0A\09mov ebx, $$0x07\0A\09pop ebx", "~{ebx},~{dirflag},~{fpsr},~{flags}"() 81 } 82 83 unsigned t10(void) { 84 unsigned i = 1, j; 85 __asm { 86 mov eax, i 87 mov j, eax 88 } 89 return j; 90 // CHECK: t10 91 // CHECK: [[I:%[a-zA-Z0-9]+]] = alloca i32, align 4 92 // CHECK: [[J:%[a-zA-Z0-9]+]] = alloca i32, align 4 93 // CHECK: store i32 1, i32* [[I]], align 4 94 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $1\0A\09mov dword ptr $0, eax", "=*m,*m,~{eax},~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}}, i32* %{{.*}}) 95 // CHECK: [[RET:%[a-zA-Z0-9]+]] = load i32* [[J]], align 4 96 // CHECK: ret i32 [[RET]] 97 } 98 99 void t11(void) { 100 __asm mov eax, 1 101 // CHECK: t11 102 // CHECK: call void asm sideeffect inteldialect "mov eax, $$1", "~{eax},~{dirflag},~{fpsr},~{flags}"() 103 } 104 105 unsigned t12(void) { 106 unsigned i = 1, j, l = 1, m; 107 __asm { 108 mov eax, i 109 mov j, eax 110 mov eax, l 111 mov m, eax 112 } 113 return j + m; 114 // CHECK: t12 115 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $2\0A\09mov dword ptr $0, eax\0A\09mov eax, dword ptr $3\0A\09mov dword ptr $1, eax", "=*m,=*m,*m,*m,~{eax},~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}}, i32* %{{.*}}, i32* %{{.*}}, i32* %{{.*}}) 116 } 117 118 void t13() { 119 char i = 1; 120 short j = 2; 121 __asm movzx eax, i 122 __asm movzx eax, j 123 // CHECK: t13 124 // CHECK: call void asm sideeffect inteldialect "movzx eax, byte ptr $0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"(i8* %{{.*}}) 125 // CHECK: call void asm sideeffect inteldialect "movzx eax, word ptr $0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"(i16* %{{.*}}) 126 } 127 128 void t14() { 129 unsigned i = 1, j = 2; 130 __asm { 131 .if 1 132 mov eax, i 133 .else 134 mov ebx, j 135 .endif 136 } 137 // CHECK: t14 138 // CHECK: call void asm sideeffect inteldialect ".if 1\0A\09mov eax, dword ptr $0\0A\09.else\0A\09mov ebx, j\0A\09.endif", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}}) 139 } 140 141 int gvar = 10; 142 void t15() { 143 int lvar = 10; 144 __asm mov eax, lvar ; eax = 10 145 __asm mov eax, offset lvar ; eax = address of lvar 146 __asm mov eax, offset gvar ; eax = address of gvar 147 // CHECK: t15 148 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}}) 149 // CHECK: call void asm sideeffect inteldialect "mov eax, $0", "r,~{eax},~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}}) 150 // CHECK: call void asm sideeffect inteldialect "mov eax, $0", "r,~{eax},~{dirflag},~{fpsr},~{flags}"(i32* @{{.*}}) 151 } 152 153 void t16() { 154 int var = 10; 155 __asm mov [eax], offset var 156 // CHECK: t16 157 // CHECK: call void asm sideeffect inteldialect "mov [eax], $0", "r,~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}}) 158 } 159 160 void t17() { 161 __asm _emit 0x4A 162 __asm _emit 0x43 163 __asm _emit 0x4B 164 __asm _EMIT 0x4B 165 // CHECK: t17 166 // CHECK: call void asm sideeffect inteldialect ".byte 0x4A", "~{dirflag},~{fpsr},~{flags}"() 167 // CHECK: call void asm sideeffect inteldialect ".byte 0x43", "~{dirflag},~{fpsr},~{flags}"() 168 // CHECK: call void asm sideeffect inteldialect ".byte 0x4B", "~{dirflag},~{fpsr},~{flags}"() 169 // CHECK: call void asm sideeffect inteldialect ".byte 0x4B", "~{dirflag},~{fpsr},~{flags}"() 170 } 171 172 void t20() { 173 char bar; 174 int foo; 175 char _bar[2]; 176 int _foo[4]; 177 178 __asm mov eax, LENGTH foo 179 __asm mov eax, LENGTH bar 180 __asm mov eax, LENGTH _foo 181 __asm mov eax, LENGTH _bar 182 // CHECK: t20 183 // CHECK: call void asm sideeffect inteldialect "mov eax, $$1", "~{eax},~{dirflag},~{fpsr},~{flags}"() 184 // CHECK: call void asm sideeffect inteldialect "mov eax, $$1", "~{eax},~{dirflag},~{fpsr},~{flags}"() 185 // CHECK: call void asm sideeffect inteldialect "mov eax, $$4", "~{eax},~{dirflag},~{fpsr},~{flags}"() 186 // CHECK: call void asm sideeffect inteldialect "mov eax, $$2", "~{eax},~{dirflag},~{fpsr},~{flags}"() 187 188 __asm mov eax, TYPE foo 189 __asm mov eax, TYPE bar 190 __asm mov eax, TYPE _foo 191 __asm mov eax, TYPE _bar 192 // CHECK: call void asm sideeffect inteldialect "mov eax, $$4", "~{eax},~{dirflag},~{fpsr},~{flags}"() 193 // CHECK: call void asm sideeffect inteldialect "mov eax, $$1", "~{eax},~{dirflag},~{fpsr},~{flags}"() 194 // CHECK: call void asm sideeffect inteldialect "mov eax, $$4", "~{eax},~{dirflag},~{fpsr},~{flags}"() 195 // CHECK: call void asm sideeffect inteldialect "mov eax, $$1", "~{eax},~{dirflag},~{fpsr},~{flags}"() 196 197 __asm mov eax, SIZE foo 198 __asm mov eax, SIZE bar 199 __asm mov eax, SIZE _foo 200 __asm mov eax, SIZE _bar 201 // CHECK: call void asm sideeffect inteldialect "mov eax, $$4", "~{eax},~{dirflag},~{fpsr},~{flags}"() 202 // CHECK: call void asm sideeffect inteldialect "mov eax, $$1", "~{eax},~{dirflag},~{fpsr},~{flags}"() 203 // CHECK: call void asm sideeffect inteldialect "mov eax, $$16", "~{eax},~{dirflag},~{fpsr},~{flags}"() 204 // CHECK: call void asm sideeffect inteldialect "mov eax, $$2", "~{eax},~{dirflag},~{fpsr},~{flags}"() 205 } 206 207 void t21() { 208 __asm { 209 __asm push ebx 210 __asm mov ebx, 0x07 211 __asm pop ebx 212 } 213 // CHECK: t21 214 // CHECK: call void asm sideeffect inteldialect "push ebx\0A\09mov ebx, $$0x07\0A\09pop ebx", "~{ebx},~{dirflag},~{fpsr},~{flags}"() 215 } 216 217 extern void t22_helper(int x); 218 void t22() { 219 int x = 0; 220 __asm { 221 __asm push ebx 222 __asm mov ebx, esp 223 } 224 t22_helper(x); 225 __asm { 226 __asm mov esp, ebx 227 __asm pop ebx 228 } 229 // CHECK: t22 230 // CHECK: call void asm sideeffect inteldialect "push ebx\0A\09mov ebx, esp", "~{ebx},~{dirflag},~{fpsr},~{flags}"() 231 // CHECK: call void @t22_helper 232 // CHECK: call void asm sideeffect inteldialect "mov esp, ebx\0A\09pop ebx", "~{ebx},~{esp},~{dirflag},~{fpsr},~{flags}"() 233 } 234 235 void t23() { 236 __asm { 237 the_label: 238 } 239 // CHECK: t23 240 // CHECK: call void asm sideeffect inteldialect "the_label:", "~{dirflag},~{fpsr},~{flags}"() 241 } 242 243 void t24_helper(void) {} 244 void t24() { 245 __asm call t24_helper 246 // CHECK: t24 247 // CHECK: call void asm sideeffect inteldialect "call $0", "r,~{dirflag},~{fpsr},~{flags}"(void ()* @t24_helper) 248 } 249 250 void t25() { 251 __asm mov eax, 0ffffffffh 252 __asm mov eax, 0fh 253 __asm mov eax, 0a2h 254 __asm mov eax, 0xa2h 255 __asm mov eax, 0xa2 256 // CHECK: t25 257 // CHECK: call void asm sideeffect inteldialect "mov eax, $$4294967295", "~{eax},~{dirflag},~{fpsr},~{flags}"() 258 // CHECK: call void asm sideeffect inteldialect "mov eax, $$15", "~{eax},~{dirflag},~{fpsr},~{flags}"() 259 // CHECK: call void asm sideeffect inteldialect "mov eax, $$162", "~{eax},~{dirflag},~{fpsr},~{flags}"() 260 // CHECK: call void asm sideeffect inteldialect "mov eax, $$0xa2h", "~{eax},~{dirflag},~{fpsr},~{flags}"() 261 // CHECK: call void asm sideeffect inteldialect "mov eax, $$0xa2", "~{eax},~{dirflag},~{fpsr},~{flags}"() 262 } 263 264 void t26() { 265 __asm pushad 266 __asm mov eax, 0 267 __asm __emit 0fh 268 __asm __emit 0a2h 269 __asm __EMIT 0a2h 270 __asm popad 271 // CHECK: t26 272 // CHECK: call void asm sideeffect inteldialect "pushad", "~{dirflag},~{fpsr},~{flags}"() 273 // CHECK: call void asm sideeffect inteldialect "mov eax, $$0", "~{eax},~{dirflag},~{fpsr},~{flags}"() 274 // CHECK: call void asm sideeffect inteldialect ".byte 0fh", "~{dirflag},~{fpsr},~{flags}"() 275 // CHECK: call void asm sideeffect inteldialect ".byte 0a2h", "~{dirflag},~{fpsr},~{flags}"() 276 // CHECK: call void asm sideeffect inteldialect ".byte 0a2h", "~{dirflag},~{fpsr},~{flags}"() 277 // CHECK: call void asm sideeffect inteldialect "popad", "~{dirflag},~{fpsr},~{flags}"() 278 } 279 280 void t27() { 281 __asm mov eax, fs:[0h] 282 // CHECK: t27 283 // CHECK: call void asm sideeffect inteldialect "mov eax, fs:[$$0h]", "~{eax},~{dirflag},~{fpsr},~{flags}"() 284 } 285 286 void t28() { 287 __asm align 8 288 __asm align 16; 289 __asm align 128; 290 __asm ALIGN 256; 291 // CHECK: t28 292 // CHECK: call void asm sideeffect inteldialect ".align 3", "~{dirflag},~{fpsr},~{flags}"() 293 // CHECK: call void asm sideeffect inteldialect ".align 4", "~{dirflag},~{fpsr},~{flags}"() 294 // CHECK: call void asm sideeffect inteldialect ".align 7", "~{dirflag},~{fpsr},~{flags}"() 295 // CHECK: call void asm sideeffect inteldialect ".align 8", "~{dirflag},~{fpsr},~{flags}"() 296 } 297 298 void t29() { 299 int arr[2] = {0, 0}; 300 int olen = 0, osize = 0, otype = 0; 301 __asm mov olen, LENGTH arr 302 __asm mov osize, SIZE arr 303 __asm mov otype, TYPE arr 304 // CHECK: t29 305 // CHECK: call void asm sideeffect inteldialect "mov dword ptr $0, $$2", "=*m,~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}}) 306 // CHECK: call void asm sideeffect inteldialect "mov dword ptr $0, $$8", "=*m,~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}}) 307 // CHECK: call void asm sideeffect inteldialect "mov dword ptr $0, $$4", "=*m,~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}}) 308 } 309 310 int results[2] = {13, 37}; 311 int *t30() 312 { 313 int *res; 314 __asm lea edi, results 315 __asm mov res, edi 316 return res; 317 // CHECK: t30 318 // CHECK: call void asm sideeffect inteldialect "lea edi, dword ptr $0", "*m,~{edi},~{dirflag},~{fpsr},~{flags}"([2 x i32]* @{{.*}}) 319 // CHECK: call void asm sideeffect inteldialect "mov dword ptr $0, edi", "=*m,~{dirflag},~{fpsr},~{flags}"(i32** %{{.*}}) 320 } 321 322 void t31() { 323 __asm pushad 324 __asm popad 325 // CHECK: t31 326 // CHECK: call void asm sideeffect inteldialect "pushad", "~{dirflag},~{fpsr},~{flags}"() 327 // CHECK: call void asm sideeffect inteldialect "popad", "~{dirflag},~{fpsr},~{flags}"() 328 } 329 330 void t32() { 331 int i; 332 __asm mov eax, i 333 __asm mov eax, dword ptr i 334 __asm mov ax, word ptr i 335 __asm mov al, byte ptr i 336 // CHECK: t32 337 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}}) 338 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}}) 339 // CHECK: call void asm sideeffect inteldialect "mov ax, word ptr $0", "*m,~{ax},~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}}) 340 // CHECK: call void asm sideeffect inteldialect "mov al, byte ptr $0", "*m,~{al},~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}}) 341 } 342 343 void t33() { 344 int i; 345 __asm mov eax, [i] 346 __asm mov eax, dword ptr [i] 347 __asm mov ax, word ptr [i] 348 __asm mov al, byte ptr [i] 349 // CHECK: t33 350 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}}) 351 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}}) 352 // CHECK: call void asm sideeffect inteldialect "mov ax, word ptr $0", "*m,~{ax},~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}}) 353 // CHECK: call void asm sideeffect inteldialect "mov al, byte ptr $0", "*m,~{al},~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}}) 354 } 355 356 void t34() { 357 __asm prefetchnta 64[eax] 358 __asm mov eax, dword ptr 4[eax] 359 // CHECK: t34 360 // CHECK: call void asm sideeffect inteldialect "prefetchnta $$64[eax]", "~{dirflag},~{fpsr},~{flags}"() 361 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $$4[eax]", "~{eax},~{dirflag},~{fpsr},~{flags}"() 362 } 363 364 void t35() { 365 __asm prefetchnta [eax + (200*64)] 366 __asm mov eax, dword ptr [eax + (200*64)] 367 // CHECK: t35 368 // CHECK: call void asm sideeffect inteldialect "prefetchnta [eax + ($$200*$$64)]", "~{dirflag},~{fpsr},~{flags}"() 369 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr [eax + ($$200*$$64)]", "~{eax},~{dirflag},~{fpsr},~{flags}"() 370 } 371 372 void t36() { 373 int arr[4]; 374 __asm mov eax, 4[arr] 375 __asm mov eax, 4[arr + 4] 376 __asm mov eax, 8[arr + 4 + 32*2 - 4] 377 __asm mov eax, 12[4 + arr] 378 __asm mov eax, 4[4 + arr + 4] 379 __asm mov eax, 4[64 + arr + (2*32)] 380 __asm mov eax, 4[64 + arr - 2*32] 381 __asm mov eax, [arr + 4] 382 __asm mov eax, [arr + 4 + 32*2 - 4] 383 __asm mov eax, [4 + arr] 384 __asm mov eax, [4 + arr + 4] 385 __asm mov eax, [64 + arr + (2*32)] 386 __asm mov eax, [64 + arr - 2*32] 387 // CHECK: t36 388 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $$4$0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"([4 x i32]* %{{.*}}) 389 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $$8$0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"([4 x i32]* %{{.*}}) 390 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $$72$0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"([4 x i32]* %{{.*}}) 391 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $$16$0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"([4 x i32]* %{{.*}}) 392 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $$12$0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"([4 x i32]* %{{.*}}) 393 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $$132$0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"([4 x i32]* %{{.*}}) 394 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $$4$0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"([4 x i32]* %{{.*}}) 395 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $$4$0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"([4 x i32]* %{{.*}}) 396 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $$64$0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"([4 x i32]* %{{.*}}) 397 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $$4$0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"([4 x i32]* %{{.*}}) 398 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $$8$0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"([4 x i32]* %{{.*}}) 399 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $$128$0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"([4 x i32]* %{{.*}}) 400 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"([4 x i32]* %{{.*}}) 401 } 402 403 void t37() { 404 __asm mov eax, 4 + 8 405 __asm mov eax, 4 + 8 * 16 406 __asm mov eax, -4 + 8 * 16 407 __asm mov eax, (4 + 4) * 16 408 __asm mov eax, 4 + 8 * -16 409 __asm mov eax, 4 + 16 / -8 410 __asm mov eax, (16 + 16) / -8 411 // CHECK: t37 412 // CHECK: call void asm sideeffect inteldialect "mov eax, $$12", "~{eax},~{dirflag},~{fpsr},~{flags}"() 413 // CHECK: call void asm sideeffect inteldialect "mov eax, $$132", "~{eax},~{dirflag},~{fpsr},~{flags}"() 414 // CHECK: call void asm sideeffect inteldialect "mov eax, $$124", "~{eax},~{dirflag},~{fpsr},~{flags}"() 415 // CHECK: call void asm sideeffect inteldialect "mov eax, $$128", "~{eax},~{dirflag},~{fpsr},~{flags}"() 416 // CHECK: call void asm sideeffect inteldialect "mov eax, $$4294967172", "~{eax},~{dirflag},~{fpsr},~{flags}"() 417 // CHECK: call void asm sideeffect inteldialect "mov eax, $$2", "~{eax},~{dirflag},~{fpsr},~{flags}"() 418 // CHECK: call void asm sideeffect inteldialect "mov eax, $$4294967292", "~{eax},~{dirflag},~{fpsr},~{flags}"() 419 } 420 421 void t38() { 422 int arr[4]; 423 __asm mov eax, 4+4[arr] 424 __asm mov eax, (4+4)[arr + 4] 425 __asm mov eax, 8*2[arr + 4 + 32*2 - 4] 426 __asm mov eax, 12+20[4 + arr] 427 __asm mov eax, 4*16+4[4 + arr + 4] 428 __asm mov eax, 4*4[64 + arr + (2*32)] 429 __asm mov eax, 4*(4-2)[64 + arr - 2*32] 430 __asm mov eax, 32*(4-2)[arr - 2*32] 431 // CHECK: t38 432 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $$8$0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"([4 x i32]* %{{.*}}) 433 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $$12$0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"([4 x i32]* %{{.*}}) 434 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $$80$0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"([4 x i32]* %{{.*}}) 435 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $$36$0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"([4 x i32]* %{{.*}}) 436 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $$76$0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"([4 x i32]* %{{.*}}) 437 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $$144$0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"([4 x i32]* %{{.*}}) 438 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $$8$0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"([4 x i32]* %{{.*}}) 439 // CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $$0$0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"([4 x i32]* %{{.*}}) 440 } 441