d: Merge upstream dmd 47871363d, druntime, c52e28b7, phobos 99e9c1b77.
[official-gcc.git] / gcc / testsuite / gdc.dg / attr_section1.d
blobc24634f7fd52bbf06ea993171a04731dcc759349
1 // { dg-do compile }
2 // { dg-require-named-sections "" }
4 import gcc.attributes;
6 @section("types")
7 struct S {} // { dg-warning ".section. attribute does not apply to types" }
9 @attribute("section", 123)
10 int f1(); // { dg-error "section attribute argument not a string constant" }
12 int f2(@section("param") int a) // { dg-error "section attribute not allowed for .a." }
14 @section("local") int v; // { dg-error "section attribute cannot be specified for local variables" }
15 return a;
18 @section("c1") void conflict();
19 @section("c2") void conflict(); // { dg-error "section of .conflict. conflicts with previous declaration" }
21 @section("c3")
22 @section("c4")
23 void conflict2(); // { dg-error "section of .conflict2. conflicts with previous declaration" }