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