llvm-project/clang/test/Driver/extract-api-multiheader-kind-diag.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

15 lines
452 B
C

// RUN: rm -rf %t
// RUN: split-file %s %t
// RUN: not %clang -target x86_64-unknown-unknown -extract-api %t/first-header.h -x objective-c-header %t/second-header.h 2>&1 | FileCheck %s
// CHECK: error: header file
// CHECK-SAME: input 'objective-c-header' does not match the type of prior input in api extraction; use '-x c-header' to override
//--- first-header.h
void dummy_function(void);
//--- second-header.h
void other_dummy_function(void);