mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-05-14 09:56:33 +00:00

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 if Token::isAtStartOfLine() indicated that we should not start a newline. Committing relying post-commit review since the change is small, some downstream uses might be blocked without this fix, and to make clear the decision of the new -fminimize-whitespace feature (fix on main, revert on clang-13.x branch) suggested by @aaron.ballman in D104601. Differential Revision: https://reviews.llvm.org/D107183
20 lines
481 B
C
20 lines
481 B
C
// RUN: %clang_cc1 -E -P %s -o - | FileCheck %s
|
|
// RUN: %clang_cc1 -E -P -fms-extensions %s -o - | FileCheck %s --check-prefix=MSEXT
|
|
|
|
// -fms-extensions changes __pragma into #pragma
|
|
// Ensure that there is a newline after the #pragma line.
|
|
|
|
#define MACRO \
|
|
text \
|
|
__pragma(PRAGMA) \
|
|
after
|
|
|
|
before MACRO text
|
|
|
|
|
|
// CHECK: before text __pragma(PRAGMA) after text
|
|
|
|
// MSEXT: before text
|
|
// MSEXT-NEXT: #pragma PRAGMA
|
|
// MSEXT-NEXT: after text
|