[lld][WebAssembly] Reinstate mistakenly disabled test. NFC
[llvm-project.git] / clang / test / Parser / asm.c
blobb4cadee4669da2c00f47580432ee4daa3c99a652
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 #if !__has_extension(gnu_asm)
4 #error Extension 'gnu_asm' should be available by default
5 #endif
7 void f1() {
8 // PR7673: Some versions of GCC support an empty clobbers section.
9 asm ("ret" : : :);
12 void f2() {
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'}}
18 void a() {
19 __asm__(""); // ok
22 // rdar://5952468
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}}
40 asm("