Fixed some bugs.
[llvm/zpu.git] / test / FrontendC++ / 2010-08-31-ByValArg.cpp
blobbe0d354b1d983152e96200938ab7d1d6539c14d4
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}
11 // XTARGET: x86_64-apple-darwin
13 class EVT {
14 public:
15 int a;
16 int b;
17 int c;
20 class VAL {
21 public:
22 int x;
23 int y;
25 void foo(EVT e);
26 EVT bar();
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);
36 EVT bar() {
37 EVT e;
38 return e;
41 void foo(EVT e) {}
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;