1 // This is a regression test on debug info to make sure that we can get a
2 // meaningful stack trace from a C++ program.
3 // RUN: %llvmgcc -S -O0 -g %s -o Output/%s.ll
4 // RUN: llvm-as < Output/%s.ll | llc -o Output/%s.s
5 // RUN: gcc -g Output/%s.s -o Output/%s.exe
6 // RUN: ( echo "break DeepStack::deepest"; echo "run 17" ; echo "where" ) | gdb Output/%s.exe | grep '#0 DeepStack::deepest (this=.*,x=33)'
13 DeepStack(int seed) : seedVal(seed) {}
15 int shallowest( int x ) { return shallower(x + 1); }
16 int shallower ( int x ) { return shallow(x + 2); }
17 int shallow ( int x ) { return deep(x + 3); }
18 int deep ( int x ) { return deeper(x + 4); }
19 int deeper ( int x ) { return deepest(x + 6); }
20 int deepest ( int x ) { return x + 7; }
22 int runit() { return shallowest(seedVal); }
25 int main ( int argc, char** argv) {
27 DeepStack DS9( (argc > 1 ? atoi(argv[1]) : 0) );