Debian Codegraph @

gcc/testsuite/gdc.dg/attr_section1.d

raw
1 // { dg-do compile }
2 // { dg-require-named-sections "" }
3
4 import gcc.attributes;
5
6 @section("types")
7 struct S {} // { dg-warning ".section. attribute does not apply to types" }
8
9 @attribute("section", 123)
10 int f1(); // { dg-error ".section. attribute argument not a string constant" }
11
12 int f2(@section("param") int a) // { dg-error "section attribute not allowed for .a." }
13 {
14 @section("local") int v; // { dg-error "section attribute cannot be specified for local variables" }
15 return a;
16 }
17
18 @section("c1") void conflict();
19 @section("c2") void conflict(); // { dg-error "section of .conflict. conflicts with previous declaration" }
20
21 @section("c3")
22 @section("c4")
23 void conflict2(); // { dg-error "section of .conflict2. conflicts with previous declaration" }