llvm-project/clang/test/Index/cindex-test-inclusions.c
Erik Verbruggen 8f9d180f09 Show inclusions from a preamble in clang_getInclusions.
When reparsing a translation unit with preamble generation turned on,
no includes are found. This is due to the fact that all SLocs from
AST/PCH files are skipped as they are 'loaded', and inclusions from a
preamble are also 'loaded'. So, in case a file has a preamble, it first
needs to process those loaded inclusions, and then check for any local
inclusions. This latter one is for any includes that are not part of the
preamble, like includes half-way through a file.

This fixes PR24748.

Differential Revision: http://reviews.llvm.org/D14329

llvm-svn: 256939
2016-01-06 15:12:51 +00:00

25 lines
772 B
C

// RUN: c-index-test -test-inclusion-stack-source %s 2>&1 | FileCheck %s
#include "include_test.h"
// CHECK: cindex-test-inclusions.c
// CHECK: included by:
// CHECK: include_test.h
// CHECK: included by:
// CHECK: cindex-test-inclusions.c:3:10
// CHECK: include_test_2.h
// CHECK: included by:
// CHECK: include_test.h:1:10
// CHECK: cindex-test-inclusions.c:3:10
// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-inclusion-stack-source %s 2>&1 | FileCheck -check-prefix=REPARSE %s
// REPARSE: include_test_2.h
// REPARSE: included by:
// REPARSE: include_test.h:1:10
// REPARSE: cindex-test-inclusions.c:3:10
// REPARSE: include_test.h
// REPARSE: included by:
// REPARSE: cindex-test-inclusions.c:3:10
// REPARSE: cindex-test-inclusions.c
// REPARSE: included by: