1 /* Verify that we can reconstruct fndecl and stack depth information
2 after early inlining. */
3
4 /* { dg-additional-options "-O2 -fdiagnostics-show-path-depths" } */
5
6 #define NULL ((void *)0)
7
8 static inline const char*
9 inner (int flag)
10 {
11 if (flag) /* { dg-message "following 'true' branch \\(when 'flag != 0'\\)\\.\\.\\. \\(fndecl 'inner', depth 3\\)" } */
12 return NULL;
13 return "foo";
14 }
15
16 static inline const char*
17 middle (int flag)
18 {
19 return inner (flag);
20 }
21
22 char
23 outer (int flag)
24 {
25 return *middle (flag); /* { dg-warning "dereference of NULL" "warning" } */
26 /* { dg-message "\\(fndecl 'outer', depth 1\\)" "message" { target *-*-* } .-1 } */
27 }