global_struct.c 705 B

123456789101112131415161718192021222324252627282930313233343536
  1. // RUN: %clang %s -g -fexceptions %extra-clang-opts -o %t
  2. // RUN: %Test_jit_debuginfo %s %t
  3. // XFAIL: host-bcc
  4. // DEBUGGER: set breakpoint pending on
  5. // DEBUGGER: break %s:34
  6. // DEBUGGER: run
  7. // DEBUGGER: print s
  8. // CHECK: $1 = {d = 0.001, d2 = {10000, 100.5}}
  9. // DEBUGGER: continue
  10. struct double_struct {
  11. double d;
  12. double d2[2];
  13. } compound_double;
  14. float f = 0.f;
  15. float *pf = &f;
  16. const double d[2][2] = {{0, 1}, {2, 3.0}};
  17. struct double_struct s;
  18. unsigned short us = -1;
  19. const unsigned long l = 1;
  20. int main(int argc, char* argv[])
  21. {
  22. int f = 10; // shadow
  23. s.d = 10e-4;
  24. s.d2[0] = 1e4;
  25. s.d2[1] = 100.5;
  26. double result = pf[0] * d[1][1] * s.d * us * l;
  27. return (result == 0 ? 0 : -1);
  28. }