parameters.cpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. struct char_struct {
  22. char c;
  23. char c2[2];
  24. } compound_char;
  25. double test_parameters(float* pf, double ppd[][2], struct char_struct& s, int** ppn = 0, unsigned short us = 10u, const unsigned long l = 42)
  26. {
  27. double result = pf[0] * ppd[1][1] * s.c * us * l;
  28. return result;
  29. }
  30. int main(int argc, char* argv[])
  31. {
  32. struct char_struct s;
  33. float f = 0.f;
  34. double d[2][2] = {{0, 1}, {2, 3.0}};
  35. s.c = 'a';
  36. s.c2[0] = '0';
  37. s.c2[1] = '1';
  38. double result = test_parameters(&f, d, s);
  39. return(result == 0 ? 0 : -1);
  40. }