(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
pr86064.c
       1  /* { dg-do compile } */
       2  /* { dg-skip-if "split DWARF unsupported" { *-*-darwin* } } */
       3  /* { dg-options "-g -O2 -fno-var-tracking-assignments -gsplit-dwarf" } */
       4  
       5  /* This used to fail with location views (implicitly) enabled, because
       6     var-tracking (not at assignments) creates a range for d starting at
       7     the load after the first call, and we did not split the range,
       8     despite its crossing between hot and cold partitions, because it's
       9     a single range, that we normally extend to the entire function.
      10     However, because the range starts at a (presumed) nonzero view, we
      11     end up outputting a loclist instead of a single location entry.
      12     But then, -gsplit-dwarf selects (startx,length) loclist entries,
      13     and the length ends up computing the difference between symbols in
      14     different subsections.  */
      15  
      16  int a;
      17  __attribute__((__cold__)) void b();
      18  
      19  void e(int *);
      20  int f();
      21  
      22  void c() {
      23    int d;
      24    e(&d);
      25    a = d;
      26    if (f())
      27      b();
      28  }