Debian Codegraph @

gcc/testsuite/g++.dg/modules/attrib-3_b.C

raw
1 // PR c++/118920
2 // { dg-additional-options "-fmodules -fno-module-lazy" }
3
4 struct A {}; // { dg-message "existing declaration here" }
5 struct [[gnu::abi_tag("b", "a")]] B; // OK
6 struct [[gnu::abi_tag("x")]] C; // { dg-message "existing declaration here" }
7 struct [[gnu::abi_tag("d")]] D; // { dg-message "existing declaration here" }
8
9 void f(); // { dg-message "existing declaration here" }
10 [[gnu::abi_tag("g")]] void g(); // { dg-message "existing declaration here" }
11 [[gnu::abi_tag("y", "x")]] void h(); // OK
12
13 [[gnu::abi_tag("more", "test")]] extern int i; // { dg-message "existing declaration here" }
14 [[gnu::abi_tag("more", "test", "really", "some")]] extern int j; // { dg-message "existing declaration here" }
15
16 import "attrib-3_a.H";
17
18 struct [[gnu::abi_tag("e")]] E; // { dg-error "adds abi tag" }
19
20 // { dg-error "mismatching abi tags for .struct A." "" { target *-*-* } 0 }
21 // B is OK
22 // { dg-error "mismatching abi tags for .struct C." "" { target *-*-* } 0 }
23 // { dg-error "mismatching abi tags for .struct D." "" { target *-*-* } 0 }
24
25 // { dg-error "mismatching abi tags for .void f()." "" { target *-*-* } 0 }
26 // { dg-error "mismatching abi tags for .void g()." "" { target *-*-* } 0 }
27 // h is OK
28
29 // { dg-error "mismatching abi tags for .i." "" { target *-*-* } 0 }
30 // { dg-error "mismatching abi tags for .j." "" { target *-*-* } 0 }