1 // RUN: %clang_cc1 -triple x86_64-linux-gnu -fsyntax-only -verify %s
3 void qualifiers(void) {
11 void unknown_qualifiers(void) {
12 asm noodle(""); // expected-error {{expected 'volatile', 'inline', 'goto', or '('}}
13 asm goto noodle("" ::::foo
); // expected-error {{expected 'volatile', 'inline', 'goto', or '('}}
14 asm volatile noodle
inline(""); // expected-error {{expected 'volatile', 'inline', 'goto', or '('}}
18 void underscores(void) {
20 __asm__
__volatile__("");
21 __asm__
__inline__("");
22 // Note: goto is not supported with underscore prefix+suffix.
23 __asm__
goto("" ::::foo
);
27 void permutations(void) {
28 asm goto inline volatile("" ::::foo
);
30 asm goto volatile inline("" ::::foo
);
31 asm goto volatile("");
32 asm inline goto volatile("" ::::foo
);
33 asm inline goto("" ::::foo
);
34 asm inline volatile goto("" ::::foo
);
35 asm inline volatile("");
36 asm volatile goto("" ::::foo
);
37 asm volatile inline goto("" ::::foo
);
38 asm volatile inline("");
42 void duplicates(void) {
43 asm volatile volatile(""); // expected-error {{duplicate asm qualifier 'volatile'}}
44 __asm__ __volatile__
__volatile__(""); // expected-error {{duplicate asm qualifier 'volatile'}}
45 asm inline inline(""); // expected-error {{duplicate asm qualifier 'inline'}}
46 __asm__ __inline__
__inline__(""); // expected-error {{duplicate asm qualifier 'inline'}}
47 asm goto goto("" ::::foo
); // expected-error {{duplicate asm qualifier 'goto'}}
48 __asm__
goto goto("" ::::foo
); // expected-error {{duplicate asm qualifier 'goto'}}
54 asm volatile (""); // expected-error {{meaningless 'volatile' on asm outside function}}
55 asm inline (""); // expected-error {{meaningless 'inline' on asm outside function}}
56 asm goto (""::::noodle
); // expected-error {{meaningless 'goto' on asm outside function}}
57 // expected-error@-1 {{expected ')'}}
58 // expected-note@-2 {{to match this '('}}