view debuginfo-tests/llgdb-tests/nested-struct.cpp @ 171:66f3bfe93da9

git version 2c4ca6832fa6b306ee6a7010bfb80a3f2596f824
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 11:07:02 +0900
parents 1d019706d866
children
line wrap: on
line source

// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
// RUN: %test_debuginfo %s %t.o
// Radar 9440721
// If debug info for my_number() is emitted outside function foo's scope
// then a debugger may not be able to handle it. At least one version of
// gdb crashes in such cases.

// DEBUGGER: ptype foo
// CHECK: int (void)

int foo() {
  struct Local {
    static int my_number() {
      return 42;
    }
  };

  int i = 0;
  i = Local::my_number();
  return i + 1;
}