[RISC-V] Avoid unnecessary extensions when value is already extended
[official-gcc.git] / gcc / testsuite / c-c++-common / analyzer / infinite-recursion-multiline-1.c
blob21f38946678eebe7d79dac59498f8c1dd5c0ec4a
1 /* Integration test of how the execution path looks for
2 -Wanalyzer-infinite-recursion. */
4 /* { dg-additional-options "-fdiagnostics-show-path-depths" } */
5 /* { dg-additional-options "-fdiagnostics-path-format=inline-events -fdiagnostics-show-caret" } */
7 void foo (int flag)
9 if (flag)
10 foo (flag); /* { dg-warning "infinite recursion" } */
13 /* { dg-begin-multiline-output "" }
14 foo (flag);
15 ^~~~~~~~~~
16 'foo': events 1-4 (depth 1)
18 | void foo (int flag)
19 | ^~~
20 | |
21 | (1) initial entry to 'foo'
23 | if (flag)
24 | ~
25 | |
26 | (2) following 'true' branch (when 'flag != 0')...
27 | foo (flag);
28 | ~~~~~~~~~~
29 | |
30 | (3) ...to here
31 | (4) calling 'foo' from 'foo'
33 +--> 'foo': events 5-6 (depth 2)
35 | void foo (int flag)
36 | ^~~
37 | |
38 | (5) recursive entry to 'foo'; previously entered at (1)
39 | (6) apparently infinite recursion
41 { dg-end-multiline-output "" { target c } } */
42 /* { dg-begin-multiline-output "" }
43 foo (flag);
44 ~~~~^~~~~~
45 'void foo(int)': events 1-4 (depth 1)
47 | void foo (int flag)
48 | ^~~
49 | |
50 | (1) initial entry to 'foo'
52 | if (flag)
53 | ~~
54 | |
55 | (2) following 'true' branch (when 'flag != 0')...
56 | foo (flag);
57 | ~~~~~~~~~~
58 | |
59 | (3) ...to here
60 | (4) calling 'foo' from 'foo'
62 +--> 'void foo(int)': events 5-6 (depth 2)
64 | void foo (int flag)
65 | ^~~
66 | |
67 | (5) recursive entry to 'foo'; previously entered at (1)
68 | (6) apparently infinite recursion
70 { dg-end-multiline-output "" { target c++ } } */