[clang] 8fbc05a - [Windows] Add test coverage for line endings when rewriting includes

Alexandre Ganea via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 6 12:38:49 PDT 2021


Author: Alexandre Ganea
Date: 2021-04-06T15:38:19-04:00
New Revision: 8fbc05acd5531a8bb74f689699e8de2788bcb769

URL: https://github.com/llvm/llvm-project/commit/8fbc05acd5531a8bb74f689699e8de2788bcb769
DIFF: https://github.com/llvm/llvm-project/commit/8fbc05acd5531a8bb74f689699e8de2788bcb769.diff

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

Validate that we're properly generating a single line ending on Windows when
using -frewrite-includes. Otherwise we're breaking split-line macros. The test
fails before 23929af383f27a6ddf23704192a25591481152b3.

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

Differential Revision: https://reviews.llvm.org/D99973

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

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/clang/test/Frontend/rewrite-includes-macros.cpp b/clang/test/Frontend/rewrite-includes-macros.cpp
new file mode 100644
index 0000000000000..4a2de546d4554
--- /dev/null
+++ b/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;
+}


        


More information about the cfe-commits mailing list