This is an archive of the discontinued LLVM Phabricator instance.

[clang/test] Correctly specify simulator env in target flag in fsanitize.c
ClosedPublic

Authored by thakis on Aug 22 2022, 10:39 AM.

Details

Summary

Putting "simulator" in the -target flag requires putting it in the
"environment" part of the triple, which is the 4th --separated component.

Some places in the tests currently use "iossimulator" which puts it in the
OS field. The triple parsing code in llvm::Triple uses startswith("ios")
in parseOS(), so that successfully sets the OS to "iOS", and all these
triples use an intel arch, and iOS + intel triple implicitly make the
driver convert the environment to "simulator", so this happened to work --
but it led to the somewhat strange "simulator-simulator" in the diag
in the test.

No behavior change.

Diff Detail

Event Timeline

thakis created this revision.Aug 22 2022, 10:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 22 2022, 10:39 AM
thakis requested review of this revision.Aug 22 2022, 10:39 AM
thakis edited the summary of this revision. (Show Details)
hans accepted this revision.Aug 23 2022, 6:58 AM

lgtm

This revision is now accepted and ready to land.Aug 23 2022, 6:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 23 2022, 7:14 AM