Debian Codegraph @

gcc/testsuite/g++.dg/ext/asmspecInvalid.C

raw
1 // tests that the asm directive is correctly handled for static fields
2 // in structures and classes. This only applies to C++; such
3 // directives generate errors in C. Assembler directives for local
4 // variables should be tested by the C test suite.
5 //
6 // Contributed by Robert Bowdidge ([email protected]) 14 Oct 2003
7
8 // { dg-do compile }
9
10 struct Foo {
11 // This should reference a variable called bar
12 int i __asm__("bar"); /* { dg-error "specifiers are not permitted" } */
13 };
14
15 int main (void ) {
16 int j = 0;
17 return j;
18 }