This is an archive of the discontinued LLVM Phabricator instance.

Update test to explicitly test with -fintegrated-as and -fno-integrated-as and to expect warnings when appropriate.
ClosedPublic

Authored by dyung on Aug 8 2019, 2:20 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

dyung created this revision.Aug 8 2019, 2:20 PM
thakis added inline comments.Aug 8 2019, 3:02 PM
clang/lib/Driver/ToolChains/Clang.cpp
3559 ↗(On Diff #214227)

We shouldn't claim the OPT_m flags if we don't use integrated-as. Claiming Wa_COMMA and Xassembler makes sense to me.

dyung marked an inline comment as done.Aug 8 2019, 3:41 PM
dyung added inline comments.
clang/lib/Driver/ToolChains/Clang.cpp
3559 ↗(On Diff #214227)

If we do not, then one of the tests you included in this change will fail if a platform defaults to not using the integrated assembler. Should I remove this change and just update the test to explicitly set -fintegrated-as/-fno-integrated-as and test for the expected result?

thakis added inline comments.Aug 8 2019, 6:46 PM
clang/lib/Driver/ToolChains/Clang.cpp
3559 ↗(On Diff #214227)

Yes, tests for the -m flags should pass -fintegrated-as. Sorry about missing that. Out of curiosity, which platforms still use external assemblers by default?

dyung updated this revision to Diff 214278.Aug 8 2019, 7:10 PM

Reverted changes in Clang.cpp and updated test to expect warning when an external assembler is requested.

dyung marked an inline comment as done.Aug 8 2019, 7:12 PM
dyung added inline comments.
clang/lib/Driver/ToolChains/Clang.cpp
3559 ↗(On Diff #214227)

Thanks, I have done this and uploaded a new revision with the test changes.

We use an external assembler internally for some legacy projects/reasons.

thakis added a comment.Aug 9 2019, 8:52 AM

Thanks! Looks like the change to the cpp file got lost? I only see the test change now.

dyung marked an inline comment as done.Aug 9 2019, 11:00 AM

Thanks! Looks like the change to the cpp file got lost? I only see the test change now.

Yes, I abandoned that change as I thought you said it was unnecessary and just left the test changes, but updated the test changes to look for the warning when a -m option is used with -fno-integrated-as.

dyung added a comment.Aug 9 2019, 11:10 AM

Oh, I just re-read your comments and realized that we should claim the Wa_COMMA and Xassembler arguments, I'll reinstate the change to just claim those.

dyung added a comment.Aug 9 2019, 11:16 AM

Actually it seems your original change already implemented that, so I think only the updated test change that I made is needed. Let me know if you disagree with that.

Can you update the patch description to say what the patch does? With that, lgtm :)

Something like "fix test for out-of-tree targets that don't enable the internal assembler by default by explicitly passing -fintegrated-as everywhere" or something like that.

dyung edited the summary of this revision. (Show Details)Aug 9 2019, 11:24 AM
dyung added a comment.Aug 9 2019, 11:31 AM

Something like "fix test for out-of-tree targets that don't enable the internal assembler by default by explicitly passing -fintegrated-as everywhere" or something like that.

Thanks. I had to figure out how to update the summary as I have never done that before!

Let me know if you have any other objections, otherwise, I'll make a further update to the summary just before I commit the change.

thakis accepted this revision.Aug 9 2019, 12:27 PM
thakis retitled this revision from Driver: Don't warn about assembler flags being unused when not assembling AND not using the integrated assembler to Update test to explicitly test with -fintegrated-as and -fno-integrated-as and to expect warnings when appropriate..
thakis edited the summary of this revision. (Show Details)

lgtm

Thanks. I moved your new description into the (previously still stale) revision title and put in a new description. lgtm.

This revision is now accepted and ready to land.Aug 9 2019, 12:28 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 9 2019, 12:48 PM