• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clangxx %s -g -fexceptions %extra-clang-opts -o %t
2 // RUN: %Test_jit_debuginfo %s %t
3 // DEBUGGER: set breakpoint pending on
4 // DEBUGGER: break %s:45
5 // DEBUGGER: run
6 // DEBUGGER: info locals
7 // CHECK: pf = 0x
8 // CHECK: s = {f = 0.00100000005, f2 = {10000, 100.5}}
9 // CHECK: us = 65535
10 // CHECK: f = 0
11 // CHECK: d = {{[{][{]}}0, 1}, {2, 3{{[}][}]}}
12 // CHECK: l = 0
13 // CHECK: result = 0
14 // DEBUGGER: continue
15 
16 struct float_struct {
17   float f;
18   float f2[2];
19 } compound_float;
20 
21 
main(int argc,char * argv[])22 int main(int argc, char* argv[])
23 {
24   float f = 0.f;
25   float *pf = &f;
26 
27   double d[2][2] = {{0, 1}, {2, 3.0}};
28   struct float_struct s;
29 
30   unsigned short us = -1;
31   const unsigned long l = static_cast<unsigned long>(-1.0e8f);
32 
33   {
34     int** ppn = 0;
35     if (ppn) {
36       return -1;
37     }
38   }
39 
40   s.f = 10e-4f;
41   s.f2[0] = 1e4f;
42   s.f2[1] = 100.5f;
43 
44   double result = pf[0] * d[1][1] * s.f * us * l;
45   return (result == 0 ? 0 : -1);
46 }
47