Devang Patel | 86ec8b3 | 2010-08-31 22:22:42 +0000 | [diff] [blame] | 1 | // This regression test checks byval arguments' debug info. |
| 2 | // Radar 8367011 |
| 3 | // RUN: %llvmgcc -S -O0 -g %s -o - | \ |
| 4 | // RUN: llc --disable-fp-elim -o %t.s -O0 -relocation-model=pic |
| 5 | // RUN: %compile_c %t.s -o %t.o |
| 6 | // RUN: %link %t.o -o %t.exe |
| 7 | // RUN: echo {break get\nrun\np missing_arg.b} > %t.in |
| 8 | // RUN: gdb -q -batch -n -x %t.in %t.exe | tee %t.out | \ |
| 9 | // RUN: grep {1 = 4242} |
| 10 | |
| 11 | // XTARGET: x86_64-apple-darwin |
| 12 | |
| 13 | class EVT { |
| 14 | public: |
| 15 | int a; |
| 16 | int b; |
| 17 | int c; |
| 18 | }; |
| 19 | |
| 20 | class VAL { |
| 21 | public: |
| 22 | int x; |
| 23 | int y; |
| 24 | }; |
| 25 | void foo(EVT e); |
| 26 | EVT bar(); |
| 27 | |
| 28 | void get(int *i, unsigned dl, VAL v, VAL *p, unsigned n, EVT missing_arg) { |
| 29 | //CHECK: .ascii "missing_arg" |
| 30 | EVT e = bar(); |
| 31 | if (dl == n) |
| 32 | foo(missing_arg); |
| 33 | } |
| 34 | |
| 35 | |
| 36 | EVT bar() { |
| 37 | EVT e; |
| 38 | return e; |
| 39 | } |
| 40 | |
| 41 | void foo(EVT e) {} |
| 42 | |
| 43 | int main(){ |
| 44 | VAL v; |
| 45 | EVT ma; |
| 46 | ma.a = 1; |
| 47 | ma.b = 4242; |
| 48 | ma.c = 3; |
| 49 | int i = 42; |
| 50 | get (&i, 1, v, &v, 2, ma); |
| 51 | return 0; |
| 52 | } |
| 53 | |