nested-struct.cpp 595 B

1234567891011121314151617181920212223242526272829
  1. // RUN: %clang %s -g -fexceptions %extra-clang-opts -o %t
  2. // RUN: %Test_jit_debuginfo %s %t
  3. // If debug info for my_number() is emitted outside function foo's scope
  4. // then a debugger may not be able to handle it. At least one version of
  5. // gdb crashes in such cases.
  6. // DEBUGGER: set breakpoint pending on
  7. // DEBUGGER: b nested-struct.cpp:28
  8. // DEBUGGER: run
  9. // DEBUGGER: ptype foo
  10. // CHECK: type = int (void)
  11. int foo() {
  12. struct Local {
  13. static int my_number() {
  14. return 42;
  15. }
  16. };
  17. int i = 0;
  18. i = Local::my_number();
  19. return i + 1;
  20. }
  21. int main() {
  22. foo();
  23. return 0;
  24. }