message-length.c 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // RUN: not %clang_cc1 -fmessage-length 72 %s 2>&1 | FileCheck -strict-whitespace %s
  2. // RUN: not %clang_cc1 -fmessage-length 1 %s
  3. // RUN: not %clang_cc1 -fmessage-length 8 %s 2>&1 | FileCheck -check-prefix=CHECK-DOT %s
  4. // Hack so we can check things better, force the file name and line.
  5. # 1 "FILE" 1
  6. /* It's tough to verify the results of this test mechanically, since
  7. the length of the filename (and, therefore, how the word-wrapping
  8. behaves) changes depending on where the test-suite resides in the
  9. file system. */
  10. void f(int, float, char, float);
  11. void g() {
  12. int (*fp1)(int, float, short, float) = f;
  13. int (*fp2)(int, float, short, float) = f;
  14. }
  15. void a_func_to_call(int, int, int);
  16. void a_very_long_line(int *ip, float *FloatPointer) {
  17. for (int ALongIndexName = 0; ALongIndexName < 100; ALongIndexName++) if (ip[ALongIndexName] == 17) a_func_to_call(ip == FloatPointer, ip[ALongIndexName], FloatPointer[ALongIndexName]);
  18. int array0[] = { [3] 3, 5, 7, 4, 2, 7, 6, 3, 4, 5, 6, 7, 8, 9, 12, 345, 14, 345, 789, 234, 678, 345, 123, 765, 234 };
  19. }
  20. #pragma STDC CX_LIMITED_RANGE // some long comment text and a brace, eh {}
  21. // CHECK: FILE:23:78
  22. // CHECK: {{^ ...// some long comment text and a brace, eh {}}}
  23. struct A { int x; };
  24. void h(struct A *a) {
  25. // CHECK-DOT: member
  26. // CHECK-DOT: reference
  27. // CHECK-DOT: type
  28. (void)a
  29. .
  30. x;
  31. }