llvm-project/clang/test/Frontend/rewrite-includes-mixed-eol-lf.h
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

12 lines
354 B
C

// Note: This header file has LF line endings.
// The indentation in some of the conditional inclusion directives below is
// intentional and is required for this test to function as a regression test
// for GH59736.
_Static_assert(__LINE__ == 5, "");
#if 1
_Static_assert(__LINE__ == 7, "");
#if 1
_Static_assert(__LINE__ == 9, "");
#endif
#endif