[PATCH] D110160: [clang][tooling] NFC: Refactor command-line diagnostic tests
Duncan P. N. Exon Smith via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 21 08:58:58 PDT 2021
dexonsmith added inline comments.
================
Comment at: clang/unittests/Tooling/ToolingTest.cpp:238-245
Args.push_back("tool-executable");
- Args.push_back("-target");
- // Invalid argument that by default results in an error diagnostic:
- Args.push_back("i386-apple-ios14.0-simulator");
- // Argument that downgrades the error into a warning:
- Args.push_back("-Wno-error=invalid-ios-deployment-target");
+ // Invalid argument (non-existent sysroot path) that will result in a warning.
+ Args.push_back("-isysroot");
+ Args.push_back("/dev/null/sysroot");
+ // Argument that will suppress the warning above.
+ Args.push_back("-Wno-missing-sysroot");
Args.push_back("-fsyntax-only");
----------------
I'm worried this is going to behave differently when the unit test isn't run on Darwin, since I think `-isysroot` is only valid for Darwin targets and there's no `-arch` or `-target` option. Can you confirm whether this should reproduce properly when run on other hosts as well?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D110160/new/
https://reviews.llvm.org/D110160
More information about the cfe-commits
mailing list