Michael Kruse | ae6b400 | 2021-07-25 21:39:08 -0500 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fminimize-whitespace -E %s 2>&1 | FileCheck %s --strict-whitespace --check-prefix=MINCOL |
| 2 | // RUN: %clang_cc1 -fminimize-whitespace -E -C %s 2>&1 | FileCheck %s --strict-whitespace --check-prefix=MINCCOL |
| 3 | // RUN: %clang_cc1 -fminimize-whitespace -E -P %s 2>&1 | FileCheck %s --strict-whitespace --check-prefix=MINWS |
| 4 | // RUN: %clang_cc1 -fminimize-whitespace -E -C -P %s 2>&1 | FileCheck %s --strict-whitespace --check-prefix=MINCWS |
Michael Kruse | c6b0b16 | 2021-07-28 22:01:14 -0500 | [diff] [blame] | 5 | // The follow empty lines ensure that a #line directive is emitted instead of newline padding after the RUN comments. |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
Michael Kruse | ae6b400 | 2021-07-25 21:39:08 -0500 | [diff] [blame] | 11 | |
| 12 | #define NOT_OMP omp something |
| 13 | #define HASH # |
| 14 | |
| 15 | int a; /* span-comment */ |
| 16 | int b ; // line-comment |
| 17 | _Pragma ( "omp barrier" ) x // more line-comments |
| 18 | #pragma omp nothing // another comment |
| 19 | HASH pragma NOT_OMP |
| 20 | int e; // again a line |
| 21 | int \ |
| 22 | f ; |
| 23 | |
| 24 | |
Michael Kruse | c6b0b16 | 2021-07-28 22:01:14 -0500 | [diff] [blame] | 25 | // MINCOL: {{^}}# 15 "{{.*}}minimize-whitespace.c"{{$}} |
Michael Kruse | ae6b400 | 2021-07-25 21:39:08 -0500 | [diff] [blame] | 26 | // MINCOL: {{^}}int a;{{$}} |
| 27 | // MINCOL-NEXT: {{^}}int b;{{$}} |
| 28 | // MINCOL-NEXT: {{^}}#pragma omp barrier{{$}} |
Michael Kruse | c6b0b16 | 2021-07-28 22:01:14 -0500 | [diff] [blame] | 29 | // MINCOL-NEXT: # 17 "{{.*}}minimize-whitespace.c" |
Michael Kruse | ae6b400 | 2021-07-25 21:39:08 -0500 | [diff] [blame] | 30 | // MINCOL-NEXT: {{^}}x{{$}} |
| 31 | // MINCOL-NEXT: {{^}}#pragma omp nothing{{$}} |
| 32 | // MINCOL-NEXT: {{^ }}#pragma omp something{{$}} |
| 33 | // MINCOL-NEXT: {{^}}int e;{{$}} |
| 34 | // MINCOL-NEXT: {{^}}int f;{{$}} |
| 35 | |
| 36 | // FIXME: Comments after pragmas disappear, even without -fminimize-whitespace |
Michael Kruse | c6b0b16 | 2021-07-28 22:01:14 -0500 | [diff] [blame] | 37 | // MINCCOL: {{^}}# 15 "{{.*}}minimize-whitespace.c"{{$}} |
Michael Kruse | ae6b400 | 2021-07-25 21:39:08 -0500 | [diff] [blame] | 38 | // MINCCOL: {{^}}int a;/* span-comment */{{$}} |
| 39 | // MINCCOL-NEXT: {{^}}int b;// line-comment{{$}} |
| 40 | // MINCCOL-NEXT: {{^}}#pragma omp barrier{{$}} |
Michael Kruse | c6b0b16 | 2021-07-28 22:01:14 -0500 | [diff] [blame] | 41 | // MINCCOL-NEXT: # 17 "{{.*}}minimize-whitespace.c" |
Michael Kruse | ae6b400 | 2021-07-25 21:39:08 -0500 | [diff] [blame] | 42 | // MINCCOL-NEXT: {{^}}x// more line-comments{{$}} |
| 43 | // MINCCOL-NEXT: {{^}}#pragma omp nothing{{$}} |
| 44 | // MINCCOL-NEXT: {{^ }}#pragma omp something{{$}} |
| 45 | // MINCCOL-NEXT: {{^}}int e;// again a line{{$}} |
| 46 | // MINCCOL-NEXT: {{^}}int f;{{$}} |
| 47 | |
| 48 | // MINWS: {{^}}int a;int b;{{$}} |
| 49 | // MINWS-NEXT: {{^}}#pragma omp barrier{{$}} |
| 50 | // MINWS-NEXT: {{^}}x{{$}} |
| 51 | // MINWS-NEXT: {{^}}#pragma omp nothing{{$}} |
| 52 | // MINWS-NEXT: {{^ }}#pragma omp something int e;int f;{{$}} |
| 53 | |
| 54 | // FIXME: Comments after pragmas disappear, even without -fminimize-whitespace |
| 55 | // MINCWS: {{^}}int a;/* span-comment */int b;// line-comment{{$}} |
| 56 | // MINCWS-NEXT: {{^}}#pragma omp barrier{{$}} |
| 57 | // MINCWS-NEXT: {{^}}x// more line-comments{{$}} |
| 58 | // MINCWS-NEXT: {{^}}#pragma omp nothing{{$}} |
| 59 | // MINCWS-NEXT: {{^ }}#pragma omp something int e;// again a line{{$}} |
| 60 | // MINCWS-NEXT: {{^}}int f; |
| 61 | |