llvm-project/clang/test/Frontend/rewrite-includes-mixed-eol-lf.c
Tom Honermann 3b1d455189 [clang] Correct -frewrite-includes generation of line control directives with mixed EOL forms.
Previously, if a header file and a source file used different end of line
(EOL) forms, preprocessed output generated with the -frewrite-includes option
would, in some cases, generate line control directives with the wrong line
number due to an error in how source file lines were counted.

Fixes https://github.com/llvm/llvm-project/issues/59736

Reviewed By: cor3ntin

Differential Revision: https://reviews.llvm.org/D140984
2023-01-05 13:24:01 -05:00

9 lines
425 B
C

// RUN: %clang_cc1 -E -frewrite-includes %s | %clang_cc1 -
// expected-no-diagnostics
// Note: This source file has LF line endings.
// This test validates that -frewrite-includes translates the end of line (EOL)
// form used in header files to the EOL form used in the the primary source
// file when the files use different EOL forms.
#include "rewrite-includes-mixed-eol-crlf.h"
#include "rewrite-includes-mixed-eol-lf.h"