1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 #if !__has_extension(gnu_asm)
4 #error Extension 'gnu_asm' should be available by default
8 // PR7673: Some versions of GCC support an empty clobbers section.
13 asm("foo" : "=r" (a
)); // expected-error {{use of undeclared identifier 'a'}}
14 asm("foo" : : "r" (b
)); // expected-error {{use of undeclared identifier 'b'}}
17 void a() __asm__(""); // expected-error {{cannot use an empty string literal in 'asm'}}
23 __asm
; // expected-error {{expected '(' after 'asm'}}
25 // <rdar://problem/10465079> - Don't crash on wide string literals in 'asm'.
26 int foo
asm (L
"bar"); // expected-error {{cannot use wide string literal in 'asm'}}
28 asm() // expected-error {{expected string literal in 'asm'}}
29 // expected-error@-1 {{expected ';' after top-level asm block}}
31 asm(; // expected-error {{expected string literal in 'asm'}}
33 asm("") // expected-error {{expected ';' after top-level asm block}}
35 // Unterminated asm strings at the end of the file were causing us to crash, so
36 // this needs to be last. rdar://15624081
37 // expected-warning@+3 {{missing terminating '"' character}}
38 // expected-error@+2 {{expected string literal in 'asm'}}
39 // expected-error@+1 {{expected ';' after top-level asm block}}