[llvm-branch-commits] [llvm] [AllocToken] Introduce AllocToken instrumentation pass (PR #156838)

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Sep 23 04:05:52 PDT 2025


================
@@ -0,0 +1,30 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
+; Test for all allocation functions that should be ignored by default.
+;
+; RUN: opt < %s -passes=inferattrs,alloc-token -S | FileCheck %s
+
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+declare ptr @strdup(ptr)
+declare ptr @__strdup(ptr)
+declare ptr @strndup(ptr, i64)
+declare ptr @__strndup(ptr, i64)
+
+define ptr @test_ignorable_allocation_functions(ptr %ptr) sanitize_alloc_token {
+; CHECK-LABEL: define ptr @test_ignorable_allocation_functions(
----------------
zmodem wrote:

nit: s/ignorable/ignored/

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


More information about the llvm-branch-commits mailing list