[llvm-branch-commits] [clang] [Clang] Introduce -fsanitize=alloc-token (PR #156839)
Hans Wennborg via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Oct 2 02:01:30 PDT 2025
================
@@ -0,0 +1,58 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 6
+//
+// Test optimization pipelines do not interfere with AllocToken lowering, and we
+// pass on function attributes correctly.
+//
+// RUN: %clang_cc1 -fsanitize=alloc-token -triple x86_64-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix=CHECK-O0 %s
+// RUN: %clang_cc1 -O1 -fsanitize=alloc-token -triple x86_64-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix=CHECK-O1 %s
+// RUN: %clang_cc1 -O2 -fsanitize=alloc-token -triple x86_64-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix=CHECK-O2 %s
----------------
zmodem wrote:
Shouldn't the expectations be the same for all optimization levels actually?
If you do need to differentiate some expectations by level, you could do `--check-prefixes=CHECK,CHECK-O0`, `--check-prefixes=CHECK,CHECK-O1` etc. and then use `CHECK` for the shared expectations, and `CHECK-O<n>` for the level-specific ones. But I'm not sure that's needed here.
https://github.com/llvm/llvm-project/pull/156839
More information about the llvm-branch-commits
mailing list