1 // RUN: %clang_cc1 -triple i386-apple-darwin9 -verify %s
2 // RUN: %clang_cc1 -triple i386-apple-darwin9 -target-feature +avx -verify %s
4 typedef unsigned int u_int32_t
;
5 typedef u_int32_t
uint32_t;
7 typedef unsigned long long u_int64_t
;
8 typedef u_int64_t
uint64_t;
10 typedef float __m128
__attribute__ ((vector_size (16)));
11 typedef float __m256
__attribute__ ((vector_size (32)));
12 typedef float __m512
__attribute__ ((vector_size (64)));
19 // Error out if size is > 32-bits.
22 __asm__
volatile("wrmsr"
25 "a" ((val
& 0xFFFFFFFFUL
)), // expected-error {{invalid input size for constraint 'a'}}
26 "d" (((val
>> 32) & 0xFFFFFFFFUL
)));
28 // Don't error out if the size of the destination is <= 32 bits.
31 __asm__
volatile("outb %0, %w1" : : "a" (data
), "Nd" (port
)); // No error expected.
33 __asm__
volatile("outb %0, %w1" : : "R" (val
), "Nd" (port
)); // expected-error {{invalid input size for constraint 'R'}}
34 __asm__
volatile("outb %0, %w1" : : "q" (val
), "Nd" (port
)); // expected-error {{invalid input size for constraint 'q'}}
35 __asm__
volatile("outb %0, %w1" : : "Q" (val
), "Nd" (port
)); // expected-error {{invalid input size for constraint 'Q'}}
36 __asm__
volatile("outb %0, %w1" : : "b" (val
), "Nd" (port
)); // expected-error {{invalid input size for constraint 'b'}}
37 __asm__
volatile("outb %0, %w1" : : "c" (val
), "Nd" (port
)); // expected-error {{invalid input size for constraint 'c'}}
38 __asm__
volatile("outb %0, %w1" : : "d" (val
), "Nd" (port
)); // expected-error {{invalid input size for constraint 'd'}}
39 __asm__
volatile("outb %0, %w1" : : "S" (val
), "Nd" (port
)); // expected-error {{invalid input size for constraint 'S'}}
40 __asm__
volatile("outb %0, %w1" : : "D" (val
), "Nd" (port
)); // expected-error {{invalid input size for constraint 'D'}}
41 __asm__
volatile("foo1 %0" : : "A" (val128
)); // expected-error {{invalid input size for constraint 'A'}}
42 __asm__
volatile("foo1 %0" : : "f" (val256
)); // expected-error {{invalid input size for constraint 'f'}}
43 __asm__
volatile("foo1 %0" : : "t" (val256
)); // expected-error {{invalid input size for constraint 't'}}
44 __asm__
volatile("foo1 %0" : : "u" (val256
)); // expected-error {{invalid input size for constraint 'u'}}
45 __asm__
volatile("foo1 %0" : : "x" (val512
)); // expected-error {{invalid input size for constraint 'x'}}
47 __asm__
volatile("foo1 %0" : "=R" (val
)); // expected-error {{invalid output size for constraint '=R'}}
48 __asm__
volatile("foo1 %0" : "=q" (val
)); // expected-error {{invalid output size for constraint '=q'}}
49 __asm__
volatile("foo1 %0" : "=Q" (val
)); // expected-error {{invalid output size for constraint '=Q'}}
50 __asm__
volatile("foo1 %0" : "=a" (val
)); // expected-error {{invalid output size for constraint '=a'}}
51 __asm__
volatile("foo1 %0" : "=b" (val
)); // expected-error {{invalid output size for constraint '=b'}}
52 __asm__
volatile("foo1 %0" : "=c" (val
)); // expected-error {{invalid output size for constraint '=c'}}
53 __asm__
volatile("foo1 %0" : "=d" (val
)); // expected-error {{invalid output size for constraint '=d'}}
54 __asm__
volatile("foo1 %0" : "=S" (val
)); // expected-error {{invalid output size for constraint '=S'}}
55 __asm__
volatile("foo1 %0" : "=D" (val
)); // expected-error {{invalid output size for constraint '=D'}}
56 __asm__
volatile("foo1 %0" : "=A" (val128
)); // expected-error {{invalid output size for constraint '=A'}}
57 __asm__
volatile("foo1 %0" : "=t" (val256
)); // expected-error {{invalid output size for constraint '=t'}}
58 __asm__
volatile("foo1 %0" : "=u" (val256
)); // expected-error {{invalid output size for constraint '=u'}}
59 __asm__
volatile("foo1 %0" : "=x" (val512
)); // expected-error {{invalid output size for constraint '=x'}}
62 __asm__
volatile("foo1 %0" : : "x" (val256
)); // No error.
63 __asm__
volatile("foo1 %0" : "=x" (val256
)); // No error.
65 __asm__
volatile("foo1 %0" : : "x" (val256
)); // expected-error {{invalid input size for constraint 'x'}}
66 __asm__
volatile("foo1 %0" : "=x" (val256
)); // expected-error {{invalid output size for constraint '=x'}}
70 int __attribute__((__target__("sse"))) _func2(void) {
71 __asm__
volatile("foo1 %0" : : "x" (val128
)); // No error.
72 __asm__
volatile("foo1 %0" : "=x" (val128
)); // No error.
74 __asm__
volatile("foo1 %0" : : "x" (val256
)); // No error.
75 __asm__
volatile("foo1 %0" : "=x" (val256
)); // No error.
77 __asm__
volatile("foo1 %0" : : "x" (val256
)); // expected-error {{invalid input size for constraint 'x'}}
78 __asm__
volatile("foo1 %0" : "=x" (val256
)); // expected-error {{invalid output size for constraint '=x'}}
80 __asm__
volatile("foo1 %0" : : "x" (val512
)); // expected-error {{invalid input size for constraint 'x'}}
81 __asm__
volatile("foo1 %0" : "=x" (val512
)); // expected-error {{invalid output size for constraint '=x'}}
84 int __attribute__((__target__("avx"))) _func3(void) {
85 __asm__
volatile("foo1 %0" : : "x" (val128
)); // No error.
86 __asm__
volatile("foo1 %0" : "=x" (val128
)); // No error.
87 __asm__
volatile("foo1 %0" : : "x" (val256
)); // No error.
88 __asm__
volatile("foo1 %0" : "=x" (val256
)); // No error.
89 __asm__
volatile("foo1 %0" : : "x" (val512
)); // expected-error {{invalid input size for constraint 'x'}}
90 __asm__
volatile("foo1 %0" : "=x" (val512
)); // expected-error {{invalid output size for constraint '=x'}}
93 int __attribute__((__target__("avx512f"))) _func4(void) {
94 __asm__
volatile("foo1 %0" : : "x" (val128
)); // No error.
95 __asm__
volatile("foo1 %0" : "=x" (val128
)); // No error.
96 __asm__
volatile("foo1 %0" : : "x" (val256
)); // No error.
97 __asm__
volatile("foo1 %0" : "=x" (val256
)); // No error.
98 __asm__
volatile("foo1 %0" : : "x" (val512
)); // No error.
99 __asm__
volatile("foo1 %0" : "=x" (val512
)); // No error.