1 /* PR c/81854 - weak alias of an incompatible symbol accepted
3 { dg-require-ifunc "" }
4 { dg-options "-Wextra" } */
6 const char* __attribute__ ((weak
, alias ("f0_target")))
7 f0 (void); /* { dg-error "alias between function and variable" } */
9 int f0_target
; /* { dg-message "aliased declaration here" } */
12 const char* __attribute__ ((weak
, alias ("f1_target")))
13 f1 (void); /* { dg-warning "alias between functions of incompatible types" } */
15 void f1_target (int *p
) /* { dg-message "aliased declaration here" } */
21 const char* __attribute__ ((alias ("f2_target")))
22 f2 (void*); /* { dg-warning "alias between functions of incompatible types" } */
24 const char* f2_target (int i
) /* { dg-message "aliased declaration here" } */
30 int __attribute__ ((ifunc ("f3_resolver")))
31 f3 (void); /* { dg-message "resolver indirect function declared here" } */
33 void* f3_resolver (void) /* { dg-warning "ifunc. resolver for .f3. should return .int \\(\\*\\)\\(void\\)." } */
39 int __attribute__ ((ifunc ("f4_resolver")))
40 f4 (void); /* { dg-message "resolver indirect function declared here" } */
42 typedef void F4 (void);
43 F4
* f4_resolver (void) /* { dg-warning ".ifunc. resolver for .f4. should return .int \\(\\*\\)\\(void\\)" } */
48 const char* __attribute__ ((ifunc ("f5_resolver")))
51 typedef const char* F5 (void);
52 F5
* f5_resolver (void)
57 int __attribute__ ((ifunc ("f6_resolver")))
58 f6 (void); /* { dg-message "resolver indirect function declared here" } */
60 int f6_resolver (void) /* { dg-error ".ifunc. resolver for 'f6' must return .int \\(\\*\\)\\(void\\)." } */