Debian Codegraph @

gcc/testsuite/c-c++-common/pr119537-2.c

raw
1 /* PR middle-end/119537 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2" } */
4
5 volatile int v;
6 void *bar (void *, void *);
7
8 void
9 foo (bool z)
10 {
11 if (z)
12 goto *&&x; /* { dg-error "reference to label 'x' defined inside of 'assume' attribute expression from outside of the attribute" } */
13 /* { dg-message "as a possible target of computed goto" "" { target c++ } .-1 } */
14 [[gnu::assume (({ x: v += 1; true; }))]];/* { dg-message "'x' defined here" } */
15 /* { dg-warning "jump to label 'x'" "" { target c++ } .-1 } */
16 /* { dg-message "enters statement expression" "" { target c++ } .-2 } */
17 [[gnu::assume (({ y: v += 1; true; }))]];/* { dg-message "'y' defined here" } */
18 /* { dg-warning "jump to label 'y'" "" { target c++ } .-1 } */
19 goto *bar (&&x, &&y); /* { dg-error "reference to label 'x' defined inside of 'assume' attribute expression from outside of the attribute" } */
20 /* { dg-error "reference to label 'y' defined inside of 'assume' attribute expression from outside of the attribute" "" { target *-*-* } .-1 } */
21 /* { dg-message "as a possible target of computed goto" "" { target c++ } .-2 } */
22 /* { dg-message "enters statement expression" "" { target c++ } .-3 } */
23 }