globals.c 823 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 %s:42
  5. // DEBUGGER: run
  6. // DEBUGGER: print pf[0]
  7. // CHECK: $1 = 0
  8. // DEBUGGER: print d[0][0]
  9. // CHECK: $2 = 0
  10. // DEBUGGER: print us
  11. // CHECK: $3 = 65535
  12. // DEBUGGER: print l
  13. // CHECK: $4 = 1
  14. // DEBUGGER: print f
  15. // CHECK: $5 = 10
  16. // DEBUGGER: continue
  17. struct double_struct {
  18. double d;
  19. double d2[2];
  20. } compound_double;
  21. float f = 0.f;
  22. float *pf = &f;
  23. const double d[2][2] = {{0, 1}, {2, 3.0}};
  24. struct double_struct s;
  25. unsigned short us = -1;
  26. const unsigned long l = 1;
  27. int main(int argc, char* argv[])
  28. {
  29. int f = 10; // shadow
  30. s.d = 10e-4;
  31. s.d2[0] = 1e4;
  32. s.d2[1] = 100.5;
  33. double result = pf[0] * d[1][1] * s.d * us * l;
  34. return (result == 0 ? 0 : -1);
  35. }