[cfe-commits] r167748 - /cfe/trunk/test/CodeGen/x86_32-inline-asm.c

Bill Wendling isanbard at gmail.com
Mon Nov 12 13:13:35 PST 2012


Author: void
Date: Mon Nov 12 15:13:35 2012
New Revision: 167748

URL: http://llvm.org/viewvc/llvm-project?rev=167748&view=rev
Log:
Update testcase to show that we don't emit an error for sizes <= 32-bits.

Modified:
    cfe/trunk/test/CodeGen/x86_32-inline-asm.c

Modified: cfe/trunk/test/CodeGen/x86_32-inline-asm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/x86_32-inline-asm.c?rev=167748&r1=167747&r2=167748&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/x86_32-inline-asm.c (original)
+++ cfe/trunk/test/CodeGen/x86_32-inline-asm.c Mon Nov 12 15:13:35 2012
@@ -8,6 +8,7 @@
 typedef u_int64_t uint64_t;
 
 int main () {
+  // Error out if size is > 32-bits.
   uint32_t msr = 0x8b;
   uint64_t val = 0;
   __asm__ volatile("wrmsr"
@@ -15,4 +16,9 @@
                    : "c" (msr),
                      "a" ((val & 0xFFFFFFFFUL)), // expected-error {{invalid input size for constraint 'a'}}
                      "d" (((val >> 32) & 0xFFFFFFFFUL)));
+
+  // Don't error out if the size of the destination is <= 32 bits.
+  unsigned char data;
+  unsigned int port;
+  __asm__ volatile("outb %0, %w1" : : "a" (data), "Nd" (port)); // No error expected.
 }





More information about the cfe-commits mailing list