This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt][asan][test] Fix lit test config on MinGW
ClosedPublic

Authored by alvinhochun on Mar 28 2023, 9:18 AM.

Details

Summary

MinGW is GCC-like and does not support clang-cl, so clean up the lit cfg
to reflect that. Also mark all Windows test cases using clang-cl as
UNSUPPORTED for now. We should probably adapt most of these test cases
to use the GCC-like clang driver, but that will be for later.

Diff Detail

Event Timeline

alvinhochun created this revision.Mar 28 2023, 9:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 28 2023, 9:18 AM
Herald added subscribers: Enna1, dberris. · View Herald Transcript
alvinhochun requested review of this revision.Mar 28 2023, 9:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 28 2023, 9:18 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
mstorsjo accepted this revision.Mar 28 2023, 1:14 PM
mstorsjo added a subscriber: llvm-commits.

Looks reasonable overall I think, nothing to object to from my point of view, just a few minor comments.. The patch is a bit unwieldy with the number of tests marked as unsupported, but I guess it's as good as it will be. If we're only touching tests that use specifically clang_cl_* to build/run, the mass editing probably is ok.

compiler-rt/test/asan/lit.cfg.py
109

Side note; since Clang 16.0.0 (fda44bedd64dbcde1b54432d99ad2f0fca0ad204) there's a new option in the GCC-style driver that does the same as /MD - -fms-runtime-lib=dll. So if/when we can assume Clang >= 16 here, we could simplify this line.

150

The RE match expression gets repeated quite a lot - is there any existing pattern for storing such things in a variable within asan (maybe for tests for other targets)?

This revision is now accepted and ready to land.Mar 28 2023, 1:14 PM
alvinhochun added inline comments.Mar 29 2023, 12:57 AM
compiler-rt/test/asan/lit.cfg.py
150

If you mean only in lit.cfg.py and lit.common.cfg.py, I guess it wouldn't hurt to use a local variable. By the way I am considering changing this check to detect msvc target instead of "not gnu".

If you mean for the UNSUPPORTED: tag in tests, I think the intended way to check for target is with the regex judging from 38e9660eaa3478b003cbc48cb4ed0adcf22e053a.

mstorsjo added inline comments.Mar 29 2023, 1:01 AM
compiler-rt/test/asan/lit.cfg.py
150

Yeah, I meant in the lit python scripts. Changing it to positively check for msvc instead of excluding gnu probably makes the logic clearer, so that sounds good!

Update msvc target check in lit python scripts