This is an archive of the discontinued LLVM Phabricator instance.

[test][ARM][CMSE] Use clang_cc1 in arm_cmse.h tests
ClosedPublic

Authored by hubert.reinterpretcast on May 10 2020, 3:57 PM.

Details

Summary

The arm_cmse.h header includes standard headers, but some tests that include this header explicitly specify a target. The standard headers found via the standard include paths need not be compatible with the explicitly-specified target from the tests. In order to avoid test failures caused by such incompatibility, this patch uses %clang_cc1, which doesn't pick up the host system headers.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptMay 10 2020, 3:57 PM

Ping, @chill. It seems you checked these files in under D70817. The way they were written has issues as indicated by the patch description. Please take a look; thanks.

chill added a comment.May 14 2020, 8:54 AM

I'm sorry, I don't understand the issue. Certainly it's the compiler (driver) responsibility to setup include paths according to the selected target.
How do you trigger a problem?

How do you trigger a problem?

If your build was configured with DEFAULT_SYSROOT to a toolchain path that has a /include directory, then the contents of that directory would be picked up. The intent of the person doing the build with regards to DEFAULT_SYSROOT is to provide a sysroot for their intended targets, which may not match the needs of the explicit target provided here.

chill added a comment.May 14 2020, 9:56 AM

I see.

I can also count (grep -rn '#include.*<std' | wc -l) 277 tests including standard headers. If they don't create a problem, wouldn't it be better to rewrite this test to use %clang_cc1 ?

  • Use clang_cc1 in arm_cmse.h tests
hubert.reinterpretcast retitled this revision from [test][ARM][CMSE] Use -ffreestanding for arm_cmse.h tests to [test][ARM][CMSE] Use clang_cc1 in arm_cmse.h tests.May 14 2020, 8:16 PM
hubert.reinterpretcast edited the summary of this revision. (Show Details)

I can also count (grep -rn '#include.*<std' | wc -l) 277 tests including standard headers. If they don't create a problem, wouldn't it be better to rewrite this test to use %clang_cc1 ?

@chill, thanks for the suggestion. I've implemented it.

chill accepted this revision.May 15 2020, 2:43 AM

LGTM, thank you.

This revision is now accepted and ready to land.May 15 2020, 2:43 AM
This revision was automatically updated to reflect the committed changes.