PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / pr61162-2.c
blob4aa8493d1a306bb3acd179561b7eb6cdf6a5fd97
1 /* PR c/61162 */
2 /* { dg-do compile } */
3 /* { dg-options "-Wc++-compat -Wpointer-sign -Wpedantic" } */
5 enum e { A };
6 struct s { int a; };
8 enum e
9 fn1 (void)
11 return 0; /* { dg-warning "10:enum conversion from 'int' to 'enum e' in return" } */
14 int
15 fn2 (struct s s)
17 return s; /* { dg-error "10:incompatible types when returning" } */
20 void
21 fn3 (void)
23 return 3; /* { dg-warning "10:in function returning void" } */
26 int
27 fn4 (int *a)
29 return a; /* { dg-warning "10:returning 'int \\*' from a function with return type 'int' makes integer from pointer without a cast" } */
32 int *
33 fn5 (int a)
35 return a; /* { dg-warning "10:returning 'int' from a function with return type 'int \\*' makes pointer from integer without a cast" } */
38 unsigned int *
39 fn6 (int *i)
41 return i; /* { dg-warning "10:pointer targets in returning 'int \\*' from a function with return type 'unsigned int \\*' differ" } */
44 void *
45 fn7 (void (*fp) (void))
47 return fp; /* { dg-warning "10:ISO C forbids return between function pointer" } */