[llvm-branch-commits] [clang] [UBSan][Ignorelist] Expanding =sanitize to global. (PR #142456)
Qinkun Bao via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Jun 2 12:10:24 PDT 2025
https://github.com/qinkunbao updated https://github.com/llvm/llvm-project/pull/142456
>From c0d1cb94966a24e12525bb5c1d863e43cd13e3c2 Mon Sep 17 00:00:00 2001
From: Qinkun Bao <qinkun at google.com>
Date: Mon, 2 Jun 2025 19:10:16 +0000
Subject: [PATCH] Change the test.
Created using spr 1.3.6
---
...relist.test => asan-global-ignorelist.test} | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
rename clang/test/CodeGen/{ubsan-global-ignorelist.test => asan-global-ignorelist.test} (60%)
diff --git a/clang/test/CodeGen/ubsan-global-ignorelist.test b/clang/test/CodeGen/asan-global-ignorelist.test
similarity index 60%
rename from clang/test/CodeGen/ubsan-global-ignorelist.test
rename to clang/test/CodeGen/asan-global-ignorelist.test
index 8d7812217f331..3ec2847a8a4e9 100644
--- a/clang/test/CodeGen/ubsan-global-ignorelist.test
+++ b/clang/test/CodeGen/asan-global-ignorelist.test
@@ -1,11 +1,11 @@
// RUN: rm -rf %t
// RUN: split-file %s %t
-// RUN: %clang -target x86_64-unknown-linux-gnu -S -emit-llvm -fsanitize=bounds %t/test.c -o - | FileCheck %s --check-prefixes=CHECK,SANITIZE
-// RUN: %clang -target x86_64-unknown-linux-gnu -S -emit-llvm -fsanitize=bounds -fsanitize-ignorelist=%t/order-0.ignorelist %t/test.c -o - | FileCheck %s --check-prefixes=CHECK,IGNORE
-// RUN: %clang -target x86_64-unknown-linux-gnu -S -emit-llvm -fsanitize=bounds -fsanitize-ignorelist=%t/order-1.ignorelist %t/test.c -o - | FileCheck %s --check-prefixes=CHECK,SANITIZE
-// RUN: %clang -target x86_64-unknown-linux-gnu -S -emit-llvm -fsanitize=bounds -fsanitize-ignorelist=%t/order-2.ignorelist %t/test.c -o - | FileCheck %s --check-prefixes=CHECK,IGNORE
-// RUN: %clang -target x86_64-unknown-linux-gnu -S -emit-llvm -fsanitize=bounds -fsanitize-ignorelist=%t/order-3.ignorelist %t/test.c -o - | FileCheck %s --check-prefixes=CHECK,SANITIZE
+// RUN: %clang -target x86_64-unknown-linux-gnu -S -emit-llvm -fsanitize=address %t/test.c -o - | FileCheck %s --check-prefixes=CHECK,SANITIZE
+// RUN: %clang -target x86_64-unknown-linux-gnu -S -emit-llvm -fsanitize=address -fsanitize-ignorelist=%t/order-0.ignorelist %t/test.c -o - | FileCheck %s --check-prefixes=CHECK,IGNORE
+// RUN: %clang -target x86_64-unknown-linux-gnu -S -emit-llvm -fsanitize=address -fsanitize-ignorelist=%t/order-1.ignorelist %t/test.c -o - | FileCheck %s --check-prefixes=CHECK,SANITIZE
+// RUN: %clang -target x86_64-unknown-linux-gnu -S -emit-llvm -fsanitize=address -fsanitize-ignorelist=%t/order-2.ignorelist %t/test.c -o - | FileCheck %s --check-prefixes=CHECK,IGNORE
+// RUN: %clang -target x86_64-unknown-linux-gnu -S -emit-llvm -fsanitize=address -fsanitize-ignorelist=%t/order-3.ignorelist %t/test.c -o - | FileCheck %s --check-prefixes=CHECK,SANITIZE
// The same type can appear multiple times within an ignorelist. Any ``=sanitize`` type
// entries enable sanitizer instrumentation, even if it was ignored by entries before.
@@ -13,18 +13,22 @@
// precedence.
//--- order-0.ignorelist
+[address]
global:global_array
//--- order-1.ignorelist
+[address]
global:global_array
global:global_array=sanitize
//--- order-2.ignorelist
+[address]
global:*
global:global_array=sanitize
global:global_array
//--- order-3.ignorelist
+[address]
global:*
global:global_array=sanitize
global:global*
@@ -34,6 +38,6 @@ global:*array=sanitize
unsigned global_array[100] = {-1};
// CHECK-LABEL: define dso_local i32 @test
-// IGNORE-NOT: call void @__ubsan_handle_out_of_bounds
-// SANITIZE: call void @__ubsan_handle_out_of_bounds
+// IGNORE-NOT: call void @__asan_report_load4
+// SANITIZE: call void @__asan_report_load4
int test(int i) { return global_array[i]; }
More information about the llvm-branch-commits
mailing list