This is an archive of the discontinued LLVM Phabricator instance.

[Preprocessor] Ensure newline after #pragma introduced by -fms-extensions.
ClosedPublic

Authored by Meinersbur on Jul 30 2021, 10:30 AM.

Details

Summary

The -fms-extensions converts __pragma (and _Pragma) into a #pragma that has to occur at the beginning of a line and end with a newline. This patch ensures that the newline after the #pragma is added even though that `Token::isAtStartOfLine() indicated that we should not start a newline.

Diff Detail

Event Timeline

Meinersbur requested review of this revision.Jul 30 2021, 10:30 AM
Meinersbur created this revision.
Meinersbur edited the summary of this revision. (Show Details)Jul 30 2021, 10:32 AM

Refine test case

  • Use %clang_cc1 because %clang adds options according to it triple, i.e. -fms-extensions is added implicitly for Windows targets.
This revision was not accepted when it landed; it landed in state Needs Review.Aug 1 2021, 5:09 PM
This revision was automatically updated to reflect the committed changes.