comparison gcc/testsuite/gcc.dg/comp-goto-2.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* Test diagnostics for addresses of labels and computed gotos. Test
2 with -pedantic. */
3 /* Origin: Joseph Myers <joseph@codesourcery.com> */
4 /* { dg-do compile } */
5 /* { dg-options "-pedantic" } */
6 /* { dg-require-effective-target indirect_jumps } */
7 /* { dg-require-effective-target label_values } */
8
9 void
10 f (void)
11 {
12 void *p = &&a; /* { dg-warning "taking the address of a label is non-standard" } */
13 goto *p; /* { dg-warning "ISO C forbids 'goto \\*expr;'" } */
14 a: ;
15 }