[ms-inline-asm] Add test cases for the align/emit directives.
authorChad Rosier <mcrosier@apple.com>
Tue, 12 Feb 2013 21:34:14 +0000 (21:34 +0000)
committerChad Rosier <mcrosier@apple.com>
Tue, 12 Feb 2013 21:34:14 +0000 (21:34 +0000)
Part of rdar://13200215

llvm-svn: 175009

clang/test/CodeGen/ms-inline-asm.c

index dbc3598..af40129 100644 (file)
@@ -161,10 +161,12 @@ void t17() {
   __asm _emit 0x4A
   __asm _emit 0x43
   __asm _emit 0x4B
+  __asm _EMIT 0x4B
 // CHECK: t17
 // CHECK:  call void asm sideeffect inteldialect ".byte 0x4A", "~{dirflag},~{fpsr},~{flags}"() nounwind
 // CHECK:  call void asm sideeffect inteldialect ".byte 0x43", "~{dirflag},~{fpsr},~{flags}"() nounwind
 // CHECK:  call void asm sideeffect inteldialect ".byte 0x4B", "~{dirflag},~{fpsr},~{flags}"() nounwind
+// CHECK:  call void asm sideeffect inteldialect ".byte 0x4B", "~{dirflag},~{fpsr},~{flags}"() nounwind
 }
 
 struct t18_type { int a, b; };
@@ -294,12 +296,14 @@ void t26() {
   __asm mov eax, 0
   __asm __emit 0fh
   __asm __emit 0a2h
+  __asm __EMIT 0a2h
   __asm popad
 // CHECK: t26
 // CHECK: call void asm sideeffect inteldialect "pushad", "~{dirflag},~{fpsr},~{flags}"() nounwind
 // CHECK: call void asm sideeffect inteldialect "mov eax, $$0", "~{eax},~{dirflag},~{fpsr},~{flags}"() nounwind
 // CHECK: call void asm sideeffect inteldialect ".byte 0fh", "~{dirflag},~{fpsr},~{flags}"() nounwind
 // CHECK: call void asm sideeffect inteldialect ".byte 0a2h", "~{dirflag},~{fpsr},~{flags}"() nounwind
+// CHECK: call void asm sideeffect inteldialect ".byte 0a2h", "~{dirflag},~{fpsr},~{flags}"() nounwind
 // CHECK: call void asm sideeffect inteldialect "popad", "~{dirflag},~{fpsr},~{flags}"() nounwind
 }
 
@@ -308,3 +312,15 @@ void t27() {
 // CHECK: t27
 // CHECK: call void asm sideeffect inteldialect "mov eax, fs:[0h]", "~{eax},~{dirflag},~{fpsr},~{flags}"() nounwind
 }
+
+void t28() {
+  __asm align 8
+  __asm align 16;
+  __asm align 128;
+  __asm ALIGN 256;
+// CHECK: t28
+// CHECK: call void asm sideeffect inteldialect ".align 3", "~{dirflag},~{fpsr},~{flags}"() nounwind
+// CHECK: call void asm sideeffect inteldialect ".align 4", "~{dirflag},~{fpsr},~{flags}"() nounwind
+// CHECK: call void asm sideeffect inteldialect ".align 7", "~{dirflag},~{fpsr},~{flags}"() nounwind
+// CHECK: call void asm sideeffect inteldialect ".align 8", "~{dirflag},~{fpsr},~{flags}"() nounwind
+}