1// RUN: %clangxx %s -O0 -g -fexceptions %extra-clang-opts -o %t 2// RUN: %Test_jit_debuginfo %s %t 3// XFAIL: host-bcc 4// (This testcase is expected to fail because of bcc optimizations that 5// are enabled by default in the absence of metadata) 6 7// DEBUGGER: set breakpoint pending on 8// DEBUGGER: break test_struct 9// DEBUGGER: run 10// DEBUGGER: step 11// DEBUGGER: print s 12// CHECK: $1 = {n = 10, n2 = {20, 21}} 13// DEBUGGER: continue 14 15struct int_struct { 16 int n; 17 int n2[2]; 18} compound_int; 19 20 21int test_struct(struct int_struct s) 22{ 23 s.n2[1]++; 24 return s.n > s.n2[0] ? s.n : s.n2[0]; 25} 26 27int main(int argc, char* argv[]) 28{ 29 struct int_struct s; 30 31 s.n = 10; 32 s.n2[0] = 20; 33 s.n2[1] = 21; 34 35 int result = test_struct(s); 36 return(result == 20 ? 0 : -1); 37} 38