ms-inline-asm: Add a test to ensure that call doesn't clobber eax.
authorEhsan Akhgari <ehsan.akhgari@gmail.com>
Thu, 31 Jul 2014 13:43:17 +0000 (13:43 +0000)
committerEhsan Akhgari <ehsan.akhgari@gmail.com>
Thu, 31 Jul 2014 13:43:17 +0000 (13:43 +0000)
Note that it's not clear whether this is the right behavior, please see
the review for the discussion.

Reviewers: rnk

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4577

llvm-svn: 214401

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

index 0378c19..06c0db8 100644 (file)
@@ -504,3 +504,9 @@ void t41(unsigned short a) {
 // CHECK: mov ss, word ptr $5
 // CHECK: "*m,*m,*m,*m,*m,*m,~{dirflag},~{fpsr},~{flags}"(i16* {{.*}}, i16* {{.*}}, i16* {{.*}}, i16* {{.*}}, i16* {{.*}}, i16* {{.*}})
 }
+
+void call_clobber() {
+  __asm call t41
+  // CHECK-LABEL: define void @call_clobber
+  // CHECK: call void asm sideeffect inteldialect "call $0", "r,~{dirflag},~{fpsr},~{flags}"(void (i16)* @t41)
+}