diff options
author | Chad Rosier <mcrosier@apple.com> | 2012-08-14 23:48:41 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2012-08-14 23:48:41 +0000 |
commit | 27ef16b326b9a9dd2440e5d1cc884e27f07e13a3 (patch) | |
tree | 7d9e71d1b37719ca532e83e42e5b0e99618ef3e5 | |
parent | 92570bd1597f355d5673a94960323f81d99c4921 (diff) |
[ms-inline asm] More test cases to make sure buildMSAsmString() doesn't regress.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161908 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/CodeGen/ms-inline-asm.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/CodeGen/ms-inline-asm.c b/test/CodeGen/ms-inline-asm.c index 18a2e8a668..c08e53b64e 100644 --- a/test/CodeGen/ms-inline-asm.c +++ b/test/CodeGen/ms-inline-asm.c @@ -43,3 +43,45 @@ void t5(void) { // CHECK: ret void __asm mov ebx, eax __asm mov ecx, ebx } + +void t6(void) { + __asm int 0x2c +// CHECK: t6 +// CHECK: call void asm sideeffect "int 0x2c", "~{dirflag},~{fpsr},~{flags}"() nounwind ia_nsdialect +} + +void* t7(void) { + __asm mov eax, fs:[0x10] +// CHECK: t7 +// CHECK: call void asm sideeffect "mov eax, fs:[0x10]", "~{dirflag},~{fpsr},~{flags}"() nounwind ia_nsdialect +} + +void t8() { + __asm { + int 0x2c ; } asm comments are fun! }{ + } + __asm {} +// CHECK: t8 +// CHECK: call void asm sideeffect "int 0x2c", "~{dirflag},~{fpsr},~{flags}"() nounwind ia_nsdialect +// CHECK: call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"() nounwind ia_nsdialect +} +int t9() { + __asm int 3 ; } comments for single-line asm + __asm {} + __asm int 4 + return 10; +// CHECK: t9 +// CHECK: call void asm sideeffect "int 3", "~{dirflag},~{fpsr},~{flags}"() nounwind ia_nsdialect +// CHECK: call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"() nounwind ia_nsdialect +// CHECK: call void asm sideeffect "int 4", "~{dirflag},~{fpsr},~{flags}"() nounwind ia_nsdialect +// CHECK: ret i32 10 +} +void t10() { + __asm { + push ebx + mov ebx, 0x07 + pop ebx + } +// CHECK: t10 +// CHECK: call void asm sideeffect "push ebx\0Amov ebx, 0x07\0Apop ebx", "~{dirflag},~{fpsr},~{flags}"() nounwind ia_nsdialect +} |