blob: be0d354b1d983152e96200938ab7d1d6539c14d4 [file] [log] [blame]
Devang Patel86ec8b32010-08-31 22:22:42 +00001// 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
13class EVT {
14public:
15 int a;
16 int b;
17 int c;
18};
19
20class VAL {
21public:
22 int x;
23 int y;
24};
25void foo(EVT e);
26EVT bar();
27
28void 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
36EVT bar() {
37 EVT e;
38 return e;
39}
40
41void foo(EVT e) {}
42
43int 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