Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.dg / pr81854.c
blob1021a811be40103dd06894f8841e5e56a847c161
1 /* PR c/81854 - weak alias of an incompatible symbol accepted
2 { dg-do compile }
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" } */
17 *p = 0;
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" } */
26 (void)&i;
27 return 0;
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\\)." } */
35 return 0;
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\\)" } */
45 return 0;
48 const char* __attribute__ ((ifunc ("f5_resolver")))
49 f5 (void);
51 typedef const char* F5 (void);
52 F5* f5_resolver (void)
54 return 0;
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\\)." } */
62 return 0;