[LLVM][IR] Use splat syntax when printing ConstantExpr based splats. (#116856)
[llvm-project.git] / clang / test / CodeGen / ms-inline-asm-variables.c
bloba830e21b1f75bf98c117280cd099d0bf419b2c47
1 // REQUIRES: x86-registered-target
2 // RUN: %clang_cc1 %s -fasm-blocks -triple i386-apple-darwin10 -emit-llvm -o - | FileCheck %s
4 int gVar;
5 void t1() {
6 // CHECK: add eax, dword ptr ${{[0-9]}}[eax]
7 __asm add eax, dword ptr gVar[eax]
8 // CHECK: add dword ptr ${{[0-9]}}[eax], eax
9 __asm add dword ptr [eax+gVar], eax
10 // CHECK: add ebx, dword ptr ${{[0-9]}}[ebx + $$270]
11 __asm add ebx, dword ptr gVar[271 - 82 + 81 + ebx]
12 // CHECK: add dword ptr ${{[0-9]}}[ebx + $$828], ebx
13 __asm add dword ptr [ebx + gVar + 828], ebx
14 // CHECK: add ecx, dword ptr ${{{[0-9]}}:P}[ecx + ecx * $$4 + $$4590]
15 __asm add ecx, dword ptr gVar[4590 + ecx + ecx*4]
16 // CHECK: add dword ptr ${{{[0-9]}}:P}[ecx + ecx * $$8 + $$73], ecx
17 __asm add dword ptr [gVar + ecx + 45 + 23 - 53 + 60 - 2 + ecx*8], ecx
18 // CHECK: add ${{{[0-9]}}:P}[ecx + ebx + $$7], eax
19 __asm add 1 + 1 + 2 + 3[gVar + ecx + ebx], eax
22 void t2(void) {
23 int lVar;
24 // CHECK: mov eax, dword ptr ${{[0-9]}}[eax]
25 __asm mov eax, dword ptr lVar[eax]
26 // CHECK: mov dword ptr ${{[0-9]}}[eax], eax
27 __asm mov dword ptr [eax+lVar], eax
28 // CHECK: mov ebx, dword ptr ${{[0-9]}}[ebx + $$270]
29 __asm mov ebx, dword ptr lVar[271 - 82 + 81 + ebx]
30 // CHECK: mov dword ptr ${{[0-9]}}[ebx + $$828], ebx
31 __asm mov dword ptr [ebx + lVar + 828], ebx
32 // CHECK: mov ${{[0-9]}}[ebx + $$47], eax
33 __asm mov 5 + 8 + 13 + 21[lVar + ebx], eax