2 // { dg-require-weak "" }
6 typedef enum { X, Y } A;
9 // { dg-final { scan-assembler ".weak\(_definition\)?\[ \t\]_?_ZN2N11D1C3fn1ENS0_1BE" { target { ! c++98 } } } }
10 static void fn1 (B) { }
11 // { dg-final { scan-assembler ".weak\(_definition\)?\[ \t\]_?_ZN2N11D1C3fn2ES1_" { target { ! c++98 } } } }
12 static void fn2 (C) { }
16 void *p = (void *) D::C::fn1;
17 void *q = (void *) D::C::fn2;
22 typedef enum { X, Y } A;
25 // { dg-final { scan-assembler-not ".weak\(_definition\)?\[ \t\]_?_ZN2N23._31C3fn1ENS0_1BE" { target { ! c++98 } } } }
26 static void fn1 (B) { } // { dg-error "no linkage" "" { target c++98 } }
27 // { dg-final { scan-assembler-not ".weak\(_definition\)?\[ \t\]_?_ZN2N23._31C3fn2ES1_" { target { ! c++98 } } } }
28 static void fn2 (C) { } // { dg-error "no linkage" "" { target c++98 } }
32 void *p = (void *) D::C::fn1;
33 void *q = (void *) D::C::fn2;
38 typedef enum { X, Y } A;
40 template <class T> struct C {
41 // { dg-final { scan-assembler ".weak\(_definition\)?\[ \t\]_?_ZN2N31D1CIiE3fn1ENS0_1BE" { target { ! c++98 } } } }
42 static void fn1 (B) { }
43 // { dg-final { scan-assembler ".weak\(_definition\)?\[ \t\]_?_ZN2N31D1CIiE3fn2ES2_" { target { ! c++98 } } } }
44 static void fn2 (C) { }
48 void *p = (void *) D::C<int>::fn1;
49 void *q = (void *) D::C<int>::fn2;
54 typedef enum { X, Y } A;
56 template <class T> struct C {
57 // { dg-final { scan-assembler-not ".weak\(_definition\)?\[ \t\]_?_ZN2N43._91CIiE3fn1ENS0_1BE" { target { ! c++98 } } } }
58 static void fn1 (B) { } // { not-dg-error "no linkage" "" { target c++98 } }
59 // { dg-final { scan-assembler-not ".weak\(_definition\)?\[ \t\]_?_ZN2N43._91CIiE3fn2ES2_" { target { ! c++98 } } } }
60 static void fn2 (C) { } // { not-dg-error "no linkage" "" { target c++98 } }
64 void *p = (void *) D::C<int>::fn1;
65 void *q = (void *) D::C<int>::fn2;