locals.cpp 917 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. struct float_struct {
  16. float f;
  17. float f2[2];
  18. } compound_float;
  19. int main(int argc, char* argv[])
  20. {
  21. float f = 0.f;
  22. float *pf = &f;
  23. double d[2][2] = {{0, 1}, {2, 3.0}};
  24. struct float_struct s;
  25. unsigned short us = -1;
  26. const unsigned long l = static_cast<unsigned long>(-1.0e8f);
  27. {
  28. int** ppn = 0;
  29. if (ppn) {
  30. return -1;
  31. }
  32. }
  33. s.f = 10e-4f;
  34. s.f2[0] = 1e4f;
  35. s.f2[1] = 100.5f;
  36. double result = pf[0] * d[1][1] * s.f * us * l;
  37. return (result == 0 ? 0 : -1);
  38. }