• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang %s -g -fexceptions %extra-clang-opts -o %t
2 // RUN: %Test_jit_debuginfo %s %t
3 // DEBUGGER: set breakpoint pending on
4 // DEBUGGER: break test_parameters
5 // DEBUGGER: run
6 // DEBUGGER: step
7 // DEBUGGER: print pf[0]
8 // CHECK: $1 = 0
9 // DEBUGGER: print ppd[1][1]
10 // CHECK: $2 = 3
11 // DEBUGGER: print s
12 // CHECK: $3 = (char_struct &)
13 // CHECK: {c = 97 'a', c2 = "01"}
14 // DEBUGGER: print ppn
15 // CHECK: $4 = (int **) 0x0
16 // DEBUGGER: print us
17 // CHECK: $5 = 10
18 // DEBUGGER: print l
19 // CHECK: $6 = 42
20 // DEBUGGER: continue
21 
22 struct char_struct {
23   char c;
24   char c2[2];
25 } compound_char;
26 
27 
test_parameters(float * pf,double ppd[][2],struct char_struct & s,int ** ppn=0,unsigned short us=10u,const unsigned long l=42)28 double test_parameters(float* pf, double ppd[][2], struct char_struct& s, int** ppn = 0, unsigned short us = 10u, const unsigned long l = 42)
29 {
30   double result = pf[0] * ppd[1][1] * s.c * us * l;
31   return result;
32 }
33 
main(int argc,char * argv[])34 int main(int argc, char* argv[])
35 {
36   struct char_struct s;
37   float f = 0.f;
38   double d[2][2] = {{0, 1}, {2, 3.0}};
39 
40   s.c = 'a';
41   s.c2[0] = '0';
42   s.c2[1] = '1';
43 
44   double result = test_parameters(&f, d, s);
45   return(result == 0 ? 0 : -1);
46 }
47