middle-end: Fix stalled swapped condition code value [PR115836]
[official-gcc.git] / gcc / testsuite / c-c++-common / analyzer / inlining-4.c
blob85b42445d26eb9a590bc81a86ef375b328b197b9
1 /* Verify that we can reconstruct fndecl and stack depth information
2 after early inlining. */
4 /* { dg-additional-options "-O2 -fdiagnostics-show-path-depths" } */
6 #include "../../gcc.dg/analyzer/analyzer-decls.h"
8 static inline const char*
9 inner (int flag)
11 if (flag)
12 /* { dg-message "following 'true' branch \\(when 'flag != 0'\\)\\.\\.\\. \\(fndecl 'inner', depth 3\\)" "" { target c } .-1 } */
13 /* { dg-message "following 'true' branch \\(when 'flag != 0'\\)\\.\\.\\. \\(fndecl 'const char\\* inner\\(int\\)', depth 3\\)" "" { target c++ } .-2 } */
14 return NULL;
15 return "foo";
18 static inline const char*
19 middle (int flag)
21 return inner (flag);
24 char
25 outer (int flag)
27 return *middle (flag); /* { dg-warning "dereference of NULL" "warning" } */
28 /* { dg-message "\\(fndecl 'outer', depth 1\\)" "message" { target c } .-1 } */
29 /* { dg-message "\\(fndecl 'char outer\\(int\\)', depth 1\\)" "message" { target c++ } .-2 } */