Skip to content

[llvm][nsan] Skip function declarations #105598

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2038,7 +2038,8 @@ static void moveFastMathFlags(Function &F,

bool NumericalStabilitySanitizer::sanitizeFunction(
Function &F, const TargetLibraryInfo &TLI) {
if (!F.hasFnAttribute(Attribute::SanitizeNumericalStability))
if (!F.hasFnAttribute(Attribute::SanitizeNumericalStability) ||
F.isDeclaration())
return false;

// This is required to prevent instrumenting call to __nsan_init from within
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"

declare float @declaration_only(float %a) sanitize_numerical_stability

; Tests with simple control flow.

@float_const = private unnamed_addr constant float 0.5
Expand Down
Loading