This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt][asan] Add noinline to use-after-scope testcases
ClosedPublic

Authored by jsji on May 8 2020, 1:38 PM.

Details

Summary

Some testcases are unexpectedly passing with NPM.
This is because the target functions are inlined in NPM.

I think we should add noinline attribute to keep these test points.

Diff Detail

Event Timeline

jsji created this revision.May 8 2020, 1:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 8 2020, 1:38 PM
Herald added subscribers: Restricted Project, dberris. · View Herald Transcript

I think we should avoid adding duplicates of compiler-rt test for new PM and add COMPILER_RT_TEST_USE_NEWPM like this one:
https://github.com/llvm/llvm-project/blob/68a9356bdea69dbcec1233f8b1fab47e72fca991/compiler-rt/test/lit.common.cfg.py#L456
to run all tests both ways

also there is COMPILER_RT_TEST_COMPILER_CFLAGS which is probably enough

jsji updated this revision to Diff 263049.May 9 2020, 8:33 PM

Remove RUN lines

jsji added a comment.EditedMay 9 2020, 8:39 PM

I think we should avoid adding duplicates of compiler-rt test for new PM and add COMPILER_RT_TEST_USE_NEWPM like this one:
https://github.com/llvm/llvm-project/blob/68a9356bdea69dbcec1233f8b1fab47e72fca991/compiler-rt/test/lit.common.cfg.py#L456
to run all tests both ways

Agree! Removed RUN lines in this patch. I will try COMPILER_RT_TEST_USE_NEWPM and COMPILER_RT_TEST_COMPILER_CFLAGS.

Do we want to force running both PM by default?
Or we can just add NEWPM run in one of the buildbot?

I think maybe the later is better, but just to double confirm.

I think we should avoid adding duplicates of compiler-rt test for new PM and add COMPILER_RT_TEST_USE_NEWPM like this one:
https://github.com/llvm/llvm-project/blob/68a9356bdea69dbcec1233f8b1fab47e72fca991/compiler-rt/test/lit.common.cfg.py#L456
to run all tests both ways

Agree! Removed RUN lines in this patch. I will try COMPILER_RT_TEST_USE_NEWPM and COMPILER_RT_TEST_COMPILER_CFLAGS.

Do we want to force running both PM by default?

As default we should keep what ever is in LLVM default.

Or we can just add NEWPM run in one of the buildbot?

yes. we can add few new steps e.g. here: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux

I think maybe the later is better, but just to double confirm.

jsji added a comment.May 11 2020, 11:24 AM

yes. we can add few new steps e.g. here: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux

Had a quick look, looks like we won't pass down COMPILER_RT_TEST_COMPILER_CFLAGS from clang/llvm for now.

But I think we can build and test standalone compile_rt by adding two steps:

  1. build standalone compiler-rt with npm by adding COMPILER_RT_TEST_COMPILER_CFLAGS
  2. test standalone compiler-rt with npm

What do you think?

vitalybuka accepted this revision.May 26 2020, 2:17 PM
This revision is now accepted and ready to land.May 26 2020, 2:17 PM
This revision was automatically updated to reflect the committed changes.