[PATCH] D99973: [Windows] Add test coverage for line endings when rewriting includes

Alexandre Ganea via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 6 10:23:39 PDT 2021


aganea created this revision.
aganea added reviewers: abhina.sreeskantharajan, rnk, amccarth, MaskRay, mstorsjo.
aganea requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Validate that we properly generating a single line ending on Windows when using `-frewrite-includes`. Otherwise we're breaking split-line macros. The test fails before D99837 <https://reviews.llvm.org/D99837>.

See discussion in https://reviews.llvm.org/D96363#2650460 and D99426 <https://reviews.llvm.org/D99426>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D99973

Files:
  clang/test/Frontend/rewrite-includes-macros.cpp


Index: clang/test/Frontend/rewrite-includes-macros.cpp
===================================================================
--- /dev/null
+++ clang/test/Frontend/rewrite-includes-macros.cpp
@@ -0,0 +1,14 @@
+// REQUIRES: system-windows
+// RUN: %clang_cl /E -Xclang -frewrite-includes %s | %clang_cl /c -Xclang -verify /Tp -
+// expected-no-diagnostics
+
+int foo();
+int bar();
+#define HELLO \
+  foo(); \
+  bar();
+
+int main() {
+  HELLO
+  return 0;
+}
\ No newline at end of file


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99973.335574.patch
Type: text/x-patch
Size: 499 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210406/41775058/attachment.bin>


More information about the cfe-commits mailing list