[llvm] [Instrumentation] Do not run sanitizers for naked functions (PR #108552)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 15 05:56:28 PDT 2024


================
@@ -0,0 +1,90 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
+; RUN: opt < %s -passes=asan -S | FileCheck %s --check-prefixes=CHECK-ASAN
+; RUN: opt < %s -passes=tsan -S | FileCheck %s --check-prefixes=CHECK-TSAN
+; RUN: opt < %s -passes=msan -S | FileCheck %s --check-prefixes=CHECK-MSAN
+; RUN: opt < %s -passes=hwasan -S | FileCheck %s --check-prefixes=CHECK-HWASAN
+; RUN: opt < %s -passes=dfsan -dfsan-track-origins=1  -S | FileCheck %s --check-prefixes=CHECK-DFSAN
+; RUN: opt < %s -passes='module(sancov-module)' -sanitizer-coverage-level=3 -sanitizer-coverage-control-flow -S | FileCheck %s --check-prefixes=CHECK-SANCOV
+; RUN: opt < %s -passes='module(sanmd-module)' -sanitizer-metadata-atomics -S | FileCheck %s --check-prefixes=CHECK-SANMD
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+define void @naked_function() naked {
----------------
nikic wrote:

See https://llvm.godbolt.org/z/K4WdqTdve. Without the byval argument there is nothing to instrument anyway, so you're not really testing anything.

https://github.com/llvm/llvm-project/pull/108552


More information about the llvm-commits mailing list