[llvm-commits] [llvm] r166638 - in /llvm/trunk/test: CodeGen/X86/ms-inline-asm.ll MC/X86/x86-32-ms-inline-asm.s

Chad Rosier mcrosier at apple.com
Wed Oct 24 16:10:28 PDT 2012


Author: mcrosier
Date: Wed Oct 24 18:10:28 2012
New Revision: 166638

URL: http://llvm.org/viewvc/llvm-project?rev=166638&view=rev
Log:
[ms-inline asm] Add back-end test case for r166632.  Make sure we emit the
correct .s output as well as get the correct encoding by the integrated
assembler.

Added:
    llvm/trunk/test/MC/X86/x86-32-ms-inline-asm.s
Modified:
    llvm/trunk/test/CodeGen/X86/ms-inline-asm.ll

Modified: llvm/trunk/test/CodeGen/X86/ms-inline-asm.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/ms-inline-asm.ll?rev=166638&r1=166637&r2=166638&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/ms-inline-asm.ll (original)
+++ llvm/trunk/test/CodeGen/X86/ms-inline-asm.ll Wed Oct 24 18:10:28 2012
@@ -38,3 +38,26 @@
 ; CHECK: .att_syntax
 ; CHECK: {{## InlineAsm End|#NO_APP}}
 }
+
+%struct.t18_type = type { i32, i32 }
+
+define i32 @t18() nounwind {
+entry:
+  %foo = alloca %struct.t18_type, align 4
+  %a = getelementptr inbounds %struct.t18_type* %foo, i32 0, i32 0
+  store i32 1, i32* %a, align 4
+  %b = getelementptr inbounds %struct.t18_type* %foo, i32 0, i32 1
+  store i32 2, i32* %b, align 4
+  call void asm sideeffect inteldialect "lea ebx, foo\0A\09mov eax, [ebx].0\0A\09mov [ebx].4, ecx", "~{eax},~{dirflag},~{fpsr},~{flags}"() nounwind
+  %b1 = getelementptr inbounds %struct.t18_type* %foo, i32 0, i32 1
+  %0 = load i32* %b1, align 4
+  ret i32 %0
+; CHECK: t18
+; CHECK: {{## InlineAsm Start|#APP}}
+; CHECK: .intel_syntax
+; CHECK: lea ebx, foo
+; CHECK: mov eax, [ebx].0
+; CHECK: mov [ebx].4, ecx
+; CHECK: .att_syntax
+; CHECK: {{## InlineAsm End|#NO_APP}}
+}

Added: llvm/trunk/test/MC/X86/x86-32-ms-inline-asm.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/x86-32-ms-inline-asm.s?rev=166638&view=auto
==============================================================================
--- llvm/trunk/test/MC/X86/x86-32-ms-inline-asm.s (added)
+++ llvm/trunk/test/MC/X86/x86-32-ms-inline-asm.s Wed Oct 24 18:10:28 2012
@@ -0,0 +1,12 @@
+// RUN: llvm-mc -triple i386-unknown-unknown --show-encoding %s | FileCheck %s
+
+.intel_syntax
+mov eax, [ebx].0
+mov [ebx].4, ecx
+.att_syntax
+        
+; CHECK: movl (%ebx), %eax
+; CHECK: encoding: [0x8b,0x03]
+; CHECK: movl %ecx, 4(%ebx)
+; CHECK: encoding: [0x89,0x4b,0x04]
+        





More information about the llvm-commits mailing list