• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -triple i386-apple-darwin9 -verify %s
2 // <rdar://problem/12415959>
3 
4 typedef unsigned int u_int32_t;
5 typedef u_int32_t uint32_t;
6 
7 typedef unsigned long long u_int64_t;
8 typedef u_int64_t uint64_t;
9 
func1()10 int func1() {
11   // Error out if size is > 32-bits.
12   uint32_t msr = 0x8b;
13   uint64_t val = 0;
14   __asm__ volatile("wrmsr"
15                    :
16                    : "c" (msr),
17                      "a" ((val & 0xFFFFFFFFUL)), // expected-error {{invalid input size for constraint 'a'}}
18                      "d" (((val >> 32) & 0xFFFFFFFFUL)));
19 
20   // Don't error out if the size of the destination is <= 32 bits.
21   unsigned char data;
22   unsigned int port;
23   __asm__ volatile("outb %0, %w1" : : "a" (data), "Nd" (port)); // No error expected.
24 }
25