Files
clang-p2996/clang/test/InstallAPI/invalid-exclusive-passes.test
Cyndy Ishida 062f6fe324 [InstallAPI] Support mutually exclusive parse options (#90686)
Projects like libc use mutually exclusive macros to compile files
multiple times and then merge the result into the final library. For
installapi to accept these, we'd need to parse the same declarations in
different ways. This patch adds the basic pipelining for installapi to
create the correct TBD file.

* -Xproject allows: -fmodules, -fobjc-arc, fvisibility=hidden, prefix
headers
* -Xlabel allows: -D and -U settings
* Error on 'private' and 'public' labels -X<label>
* Xplatform allows: -iframework <path> This is to support the case where
zippered frameworks want to pass in iOSSupport search path.
2024-05-10 09:35:41 -07:00

38 lines
1.4 KiB
Plaintext

; RUN: rm -rf %t
; RUN: split-file %s %t
// Validate arguments not allowed with -X
; RUN: not clang-installapi \
; RUN: -target arm64-apple-macos12 \
; RUN: -install_name @rpath/libfoo.dylib \
; RUN: -current_version 1 -compatibility_version 1 \
; RUN: -XApple -I/fake/path -I%t %t/inputs.json \
; RUN: -dynamiclib -o %t/output.tbd 2>&1 | FileCheck %s --check-prefix=INVALID_OPT
; INVALID_OPT: error: invalid argument '-XApple' not allowed with '-I/fake/path'
// Validate reserved labels.
; RUN: not clang-installapi \
; RUN: -target arm64-apple-macos12 \
; RUN: -install_name @rpath/libfoo.dylib \
; RUN: -current_version 1 -compatibility_version 1 \
; RUN: -XApple -DDarwin=1 -XElf -DNONDarwin=1 \
; RUN: -I%t -dynamiclib -o %t/output.tbd %t/inputs.json \
; RUN: -XPrivate -DInvalid=1 2>&1 | FileCheck %s --check-prefix=INVALID_LABELS
; INVALID_LABELS: error: label 'Private' is reserved: use a different label name for -X<label>
// Validate arguments not allowed with -Xproject
; RUN: not clang-installapi \
; RUN: -target arm64-apple-macos12 \
; RUN: -install_name @rpath/libfoo.dylib \
; RUN: -current_version 1 -compatibility_version 1 \
; RUN: -Xproject -fprofile-instr-generate \
; RUN: %t/inputs.json -I%t -dynamiclib \
; RUN: -o %t/output.tbd 2>&1 | FileCheck %s --check-prefix=INVALID_PROJECT_OPT
; INVALID_PROJECT_OPT: error: invalid argument '-Xproject' not allowed with '-fprofile-instr-generate'
;--- inputs.json
{
"headers": [ ],
"version": "3"
}