1 /* { dg-additional-options "-fdiagnostics-show-line-numbers -fdiagnostics-path-format=inline-events -fdiagnostics-show-caret" } */
2 /* { dg-enable-nn-line-numbers "" } */
3 /* { dg-require-effective-target indirect_jumps } */
5 #include "../../gcc.dg/analyzer/test-setjmp.h"
7 #include "../../gcc.dg/analyzer/analyzer-decls.h"
11 static void inner (void)
22 longjmp (env
, 42); /* { dg-warning "'longjmp' called after enclosing function of 'setjmp' has returned" } */
25 /* { dg-begin-multiline-output "" }
26 NN | longjmp (env, 42);
30 | NN | void outer (void)
33 | | (1) entry to 'outer'
38 | | (2) calling 'inner' from 'outer'
42 | NN | static void inner (void)
45 | | (3) entry to 'inner'
52 | | (4) 'setjmp' called here
59 | | (5) stack frame is popped here, invalidating saved environment
68 | | (6) returning to 'outer' from 'inner'
70 | NN | longjmp (env, 42);
73 | | (7) 'longjmp' called after enclosing function of 'setjmp' returned at (5)
75 { dg-end-multiline-output "" { target c } } */
76 /* { dg-begin-multiline-output "" }
77 NN | longjmp (env, 42);
79 'void outer()': events 1-2
81 | NN | void outer (void)
84 | | (1) entry to 'outer'
89 | | (2) calling 'inner' from 'outer'
91 +--> 'void inner()': event 3
93 | NN | static void inner (void)
96 | | (3) entry to 'inner'
98 'void inner()': event 4
103 | | (4) 'setjmp' called here
105 'void inner()': event 5
110 | | (5) stack frame is popped here, invalidating saved environment
114 'void outer()': events 6-7
119 | | (6) returning to 'outer' from 'inner'
121 | NN | longjmp (env, 42);
122 | | ~~~~~~~~~~~~~~~~~
124 | | (7) 'longjmp' called after enclosing function of 'setjmp' returned at (5)
126 { dg-end-multiline-output "" { target c++ } } */