]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/g++.dg/asm-qual-3.C
0bf60697ea5ca378015074d7840c8e8969f6057f
[thirdparty/gcc.git] / gcc / testsuite / g++.dg / asm-qual-3.C
1 // Test that asm-qualifiers are not allowed on toplevel asm.
2 // { dg-do compile }
3 // { dg-options "-std=gnu++98" }
4
5 asm const (""); // { dg-error {'const' is not an asm qualifier} }
6 asm volatile (""); // { dg-warning {asm qualifier 'volatile' ignored outside of function body} }
7 asm restrict (""); // { dg-error {expected '\(' before 'restrict'} }
8 asm inline (""); // { dg-error {asm qualifier outside of function body} }
9 asm goto (""); // { dg-error {asm qualifier outside of function body} }
10
11 // There are many other things wrong with this code, so:
12 // { dg-excess-errors "" }