This is an archive of the discontinued LLVM Phabricator instance.

[ubsan][test] Add test to check interaction between inlining and attribute no_sanitize("undefined")
Needs ReviewPublic

Authored by vhscampos on Jul 15 2022, 9:42 AM.

Details

Reviewers
eugenis
Summary

A function with attribute no_sanitize("undefined") should not have UBSAN
checks generated for its body. This requirement must stay true even if
said function is inlined.

This patch adds a tests to check this behaviour. Similar tests already
exist for ASAN and MSAN.

Diff Detail

Event Timeline

vhscampos created this revision.Jul 15 2022, 9:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 15 2022, 9:42 AM
Herald added a subscriber: Enna1. · View Herald Transcript
vhscampos requested review of this revision.Jul 15 2022, 9:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 15 2022, 9:42 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript

Similar tests already exist for ASAN and MSAN.

Is that really true? Any difference in sanitize/no_sanitize IR attributes suppresses normal inlining, but always_inline trumps that.

This test should work for ubsan because ubsan instrumentation is done in the frontend before any inlining, but I believe this is not true for asan and msan.