]> granicus.if.org Git - clang/commitdiff
Update testcase to show that we don't emit an error for sizes <= 32-bits.
authorBill Wendling <isanbard@gmail.com>
Mon, 12 Nov 2012 21:13:35 +0000 (21:13 +0000)
committerBill Wendling <isanbard@gmail.com>
Mon, 12 Nov 2012 21:13:35 +0000 (21:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167748 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/x86_32-inline-asm.c

index 0596ba4307c81aacd5a9ab1080a2c273ef88ed54..7b342a6a265acd0f1c5572e764f5cc6bec65f05e 100644 (file)
@@ -8,6 +8,7 @@ typedef unsigned long long u_int64_t;
 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 @@ int main () {
                    : "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.
 }