This is an archive of the discontinued LLVM Phabricator instance.

Do not assume that -fsanitize=address is valid option in clang tests
AbandonedPublic

Authored by christof on Jun 7 2016, 9:37 AM.

Details

Summary

The asan tests should only run on builds that have LLVM_USE_SANITIZER set. The feature 'asan' reflects this and is required for test/CodeGen/lifetime-asan.c

Diff Detail

Repository
rL LLVM

Event Timeline

christof updated this revision to Diff 59900.Jun 7 2016, 9:37 AM
christof retitled this revision from to Do not assume that -fsanitize=address is valid option in clang tests.
christof updated this object.
christof added reviewers: vitalybuka, chapuni.
christof set the repository for this revision to rL LLVM.
christof added a subscriber: cfe-commits.

This doesn’t make sense to me, Clang is able to produce ASanified code even when the compiler itself isn’t ASanified (that’s what LLVM_USE_SANITIZER does). Where exactly is this test failing?

vitalybuka edited edge metadata.Jun 7 2016, 6:36 PM

I guess you can remove // UNSUPPORTED: mingw32 added by cfe/trunk@271509

vitalybuka accepted this revision.Jun 7 2016, 7:35 PM
vitalybuka edited edge metadata.

Actually there are other tests with -fsanitize=address
I see only difference in %clang vs %clang_cc1?
Could you try this?

This revision is now accepted and ready to land.Jun 7 2016, 7:35 PM
vitalybuka requested changes to this revision.Jun 7 2016, 7:35 PM
vitalybuka edited edge metadata.

It was accepted accidentally.

This revision now requires changes to proceed.Jun 7 2016, 7:35 PM

Oh, I see, most asan tests in clang use cross-compiler, e.g.: -target x86_64-linux-gnu

In D21082#451393, @kubabrecka wrote:

This doesn’t make sense to me, Clang is able to produce ASanified code even when the compiler itself isn’t ASanified (that’s what LLVM_USE_SANITIZER does). Where exactly is this test failing?

Right. I was confused about the meaning of that feature. The test fails with:
clang-3.9: error: unsupported option '-fsanitize=address' for target 'aarch64-arm-none-eabi’

The patch suggested by vitalybuka seems to work. So I suggest we go for that.

christof abandoned this revision.Jun 8 2016, 3:17 AM