Debian Codegraph @

gcc/testsuite/gdc.dg/attr_symver1.d

raw
1 // { dg-do compile }
2 // { dg-skip-if "only works for ELF targets" { *-*-darwin* *-*-aix* } }
3
4 import gcc.attributes;
5
6 @symver("type")
7 struct S {} // { dg-warning ".symver. attribute does not apply to types" }
8
9 @attribute("symver", 123)
10 int f1(); // { dg-error ".symver. attribute argument not a string constant" }
11
12 @symver("format")
13 int f2() // { dg-error "symver attribute argument must have format .name@nodename'" }
14 { // { dg-error ".symver. attribute argument .format. must contain one or two .@." "" { target *-*-* } .-1 }
15 return 0;
16 }
17
18 int f3(@symver("param@VER_1") int param) // { dg-warning ".symver. attribute only applies to functions and variables" }
19 {
20 return param;
21 }
22
23 @symver("extern@VER_2")
24 extern int f4(); // { dg-error "symbol needs to be defined to have a version" }