llvm-project/clang/test/Index/single-file-parse-include-macro.c
Jan Svoboda dcb9078081
[clang][index] Skip over #include UNDEF_IDENT in single-file-parse mode (#135218)
In the 'single-file-parse' mode, seeing `#include UNDEFINED_IDENTIFIER`
should not be treated as an error. The identifier might be defined in a
header that we decided to skip, resulting in a nonsensical diagnostic
from the user point of view.
2025-04-10 12:32:01 -07:00

11 lines
302 B
C

// RUN: split-file %s %t
// RUN: c-index-test -single-file-parse %t/tu.c 2>&1 | FileCheck --allow-empty %t/tu.c
//--- header1.h
#define HEADER2_H "header2.h"
//--- header2.h
//--- tu.c
#include "header1.h"
// CHECK-NOT: tu.c:[[@LINE+1]]:10: error: expected "FILENAME" or <FILENAME>
#include HEADER2_H