OSDN Git Service

* gcc.dg/testsuite/c++98.c,c++98-pedantic.c,c89.c,c89-pedantic.c,
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / wtr-switch-1.c
1 /* Test for -Wtraditional warnings on switch operands of type long.
2    Note, gcc should omit these warnings in system header files.
3    By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/22/2000.  */
4 /* { dg-do compile } */
5 /* { dg-options "-Wtraditional" } */
6
7 void
8 testfunc (long l)
9 {
10   switch (l) /* { dg-warning "switch expression" "switch expression" } */
11   {
12   default:
13     break;
14   }
15
16 #line 17 "sys-header.h" 3
17 /* We are in system headers now, no -Wtraditional warnings should issue.  */
18
19   switch (l)
20   {
21   default:
22     break;
23   }
24 }