[compiler-rt] [asan][Darwin] Simplify test (PR #105599)

via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 21 17:34:13 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Vitaly Buka (vitalybuka)

<details>
<summary>Changes</summary>

This is not a goal to check order of sections.
The goal is make sure there is only one "Hello"
string and it's in __asan_cstring.


---
Full diff: https://github.com/llvm/llvm-project/pull/105599.diff


1 Files Affected:

- (modified) compiler-rt/test/asan/TestCases/Darwin/cstring_section.c (+2-6) 


``````````diff
diff --git a/compiler-rt/test/asan/TestCases/Darwin/cstring_section.c b/compiler-rt/test/asan/TestCases/Darwin/cstring_section.c
index d72b0ba8a8bb33..93ed009bb197de 100644
--- a/compiler-rt/test/asan/TestCases/Darwin/cstring_section.c
+++ b/compiler-rt/test/asan/TestCases/Darwin/cstring_section.c
@@ -1,15 +1,11 @@
 // Test that AddressSanitizer moves constant strings into a separate section.
 
 // RUN: %clang_asan -c -o %t %s
-// RUN: llvm-objdump -s %t | FileCheck %s
+// RUN: llvm-objdump -s %t | FileCheck %s --implicit-check-not="Hello."
 
 // Check that "Hello.\n" is in __asan_cstring and not in __cstring.
 // CHECK: Contents of section {{.*}}__asan_cstring:
-// CHECK: 48656c6c {{.*}} Hello.
-// CHECK: Contents of section {{.*}}__const:
-// CHECK-NOT: 48656c6c {{.*}} Hello.
-// CHECK: Contents of section {{.*}}__cstring:
-// CHECK-NOT: 48656c6c {{.*}} Hello.
+// CHECK-NEXT: 48656c6c {{.*}} Hello.
 
 int main(int argc, char *argv[]) {
   argv[0] = "Hello.\n";

``````````

</details>


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


More information about the llvm-commits mailing list