llvm-project/clang/test/Driver/extract-api-multiheader.h
Daniel Grumberg edbb99a7ed Ensure -extract-api handles multiple headers correctly
clang -extract-api should accept multiple headers and forward them to a
single CC1 instance. This change introduces a new ExtractAPIJobAction.
Currently API Extraction is done during the Precompile phase as this is
the current phase that matches the requirements the most. Adding a new
phase would need to change some logic in how phases are scheduled. If
the headers scheduled for API extraction are of different types the
driver emits a diagnostic.

Differential Revision: https://reviews.llvm.org/D121936
2022-03-21 21:04:47 +00:00

24 lines
782 B
C

// RUN: rm -rf %t
// RUN: split-file %s %t
// RUN: %clang -target x86_64-unknown-unknown -ccc-print-phases -extract-api %t/first-header.h %t/second-header.h 2> %t1
// RUN: echo 'END' >> %t1
// RUN: FileCheck -check-prefix EXTRACT-API-PHASES -input-file %t1 %s
// EXTRACT-API-PHASES: 0: input
// EXTRACT-API-PHASES-SAME: , c-header
// EXTRACT-API-PHASES-NEXT: 1: preprocessor, {0}, c-header-cpp-output
// EXTRACT-API-PHASES-NEXT: 2: input
// EXTRACT-API-PHASES-SAME: , c-header
// EXTRACT-API-PHASES-NEXT: 3: preprocessor, {2}, c-header-cpp-output
// EXTRACT-API-PHASES-NEXT: 4: api-extractor, {1, 3}, api-information
// EXTRACT-API-PHASES-NOT: 5:
// EXTRACT-API-PHASES: END
//--- first-header.h
void dummy_function(void);
//--- second-header.h
void other_dummy_function(void);