Debian Codegraph @

gcc/testsuite/g++.dg/DRs/dr2262.C

raw
1 // DR 2262 - Attributes for asm-definition
2 // { dg-do compile { target c++11 } }
3 // { dg-options "-Wattributes" }
4
5 [[]] asm ("nop");
6 [[foo::bar]] asm ("nop"); // { dg-warning "attributes ignored on 'asm' declaration" }
7
8 void
9 foo ()
10 {
11 int i = 42;
12 [[]] asm ("nop");
13 [[foo::bar]] asm ("nop"); // { dg-warning "attributes ignored on 'asm' declaration" }
14 [[]] asm ("nop" : "+r" (i));
15 [[foo::bar]] [[bar::baz]] asm ("nop" : "+r" (i)); // { dg-warning "attributes ignored on 'asm' declaration" }
16 }