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  typedef __SIZE_TYPE__ size_t;
       7  #define NULL ((void *)0)
       8  
       9  struct input_file_st 
      10  {
      11    char inpname[1];
      12  };
      13  
      14  typedef struct input_file_st input_file;
      15  
      16  static inline const char*
      17  get_input_file_name (const input_file *inpf)
      18  {
      19    if (inpf) /* { dg-message "following 'false' branch \\(when 'inpf' is NULL\\)\\.\\.\\. \\(fndecl 'get_input_file_name', depth 2\\)" } */
      20      return inpf->inpname;
      21    return NULL;
      22  }
      23  
      24  size_t
      25  test (const input_file *inpf)
      26  {
      27    const char *f = get_input_file_name (inpf);
      28    return __builtin_strlen (f); /* { dg-warning "use of NULL" "warning" } */
      29    /* { dg-message "NULL where non-null expected \\(fndecl 'test', depth 1\\)" "message" { target *-*-* } .-1 } */
      30  }