David Greene | 4a37a69 | 2009-07-16 22:24:20 +0000 | [diff] [blame] | 1 | // This is a regression test on debug info to make sure that we can |
| 2 | // print line numbers in asm. |
Dan Gohman | 2b62af2 | 2009-12-05 00:02:37 +0000 | [diff] [blame] | 3 | // RUN: %llvmgcc -S -O0 -g %s -o - | \ |
Dan Gohman | 4698bab | 2009-12-05 00:23:29 +0000 | [diff] [blame] | 4 | // RUN: llc --disable-fp-elim -O0 -relocation-model=pic | grep { 2009-07-15-LineNumbers.cpp:25$} |
David Greene | 4a37a69 | 2009-07-16 22:24:20 +0000 | [diff] [blame] | 5 | |
| 6 | #include <stdlib.h> |
| 7 | |
| 8 | class DeepStack { |
| 9 | int seedVal; |
| 10 | public: |
| 11 | DeepStack(int seed) : seedVal(seed) {} |
| 12 | |
| 13 | int shallowest( int x ) { return shallower(x + 1); } |
| 14 | int shallower ( int x ) { return shallow(x + 2); } |
| 15 | int shallow ( int x ) { return deep(x + 3); } |
| 16 | int deep ( int x ) { return deeper(x + 4); } |
| 17 | int deeper ( int x ) { return deepest(x + 6); } |
| 18 | int deepest ( int x ) { return x + 7; } |
| 19 | |
| 20 | int runit() { return shallowest(seedVal); } |
| 21 | }; |
| 22 | |
| 23 | int main ( int argc, char** argv) { |
| 24 | |
| 25 | DeepStack DS9( (argc > 1 ? atoi(argv[1]) : 0) ); |
| 26 | return DS9.runit(); |
| 27 | } |