File tree 2 files changed +14
-9
lines changed
2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -159,8 +159,9 @@ void Parsing::EmitPreprocessedSource(
159
159
// which signifies a comment (directive) in both source forms.
160
160
inDirective = true ;
161
161
}
162
- if (inDirective && directive.size () < directiveNameLength &&
163
- IsLetter (ch)) {
162
+ bool inDirectiveSentinel{
163
+ inDirective && directive.size () < directiveNameLength};
164
+ if (inDirectiveSentinel && IsLetter (ch)) {
164
165
directive += getOriginalChar (ch);
165
166
}
166
167
@@ -211,7 +212,8 @@ void Parsing::EmitPreprocessedSource(
211
212
out << ' ' ;
212
213
}
213
214
}
214
- if (!inContinuation && position && position->column <= 72 && ch != ' ' ) {
215
+ if (!inContinuation && !inDirectiveSentinel && position &&
216
+ position->column <= 72 && ch != ' ' ) {
215
217
// Preserve original indentation
216
218
for (; column < position->column ; ++column) {
217
219
out << ' ' ;
Original file line number Diff line number Diff line change 1
- ! RUN: %flang -E -fopenmp -fopenacc %s 2>&1 | FileCheck %s
2
- ! CHECK: !$OMP parallel default(shared) private(super_very_long_name_for_the_va&
3
- ! CHECK: !$OMP&riable)
4
- ! CHECK: !$acc data copyin(super_very_long_name_for_the_variable, another_super&
5
- ! CHECK: !$acc&_wordy_variable_to_test)
6
- ! Test correct continuations in compiler directives
1
+ ! RUN: %flang -E -fopenmp -fopenacc %s 2>&1 | FileCheck --strict-whitespace %s
2
+ ! CHECK: {{^}}!$OMP parallel default(shared) private(super_very_long_name_for_the_va&
3
+ ! CHECK-NEXT: {{^}}!$OMP&riable)
4
+ ! CHECK: {{^}}!$acc data copyin(super_very_long_name_for_the_variable, another_super&
5
+ ! CHECK-NEXT: {{^}}!$acc&_wordy_variable_to_test)
6
+ ! CHECK: {{^}}!$OMP something something
7
+ ! Test correct continuations in compiler directives and left-alignment of sentinels
7
8
subroutine foo
8
9
integer :: super_very_long_name_for_the_variable
9
10
integer :: another_super_wordy_variable_to_test
@@ -15,4 +16,6 @@ subroutine foo
15
16
16
17
! $acc data copyin(super_very_long_name_for_the_variable, another_super_wordy_variable_to_test)
17
18
! $acc end data
19
+
20
+ ! $OMP something something
18
21
end subroutine foo
You can’t perform that action at this time.
0 commit comments