[compiler-rt] Test PR, please ignore (PR #100439)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 31 09:20:10 PDT 2024


https://github.com/AdvenamTacet updated https://github.com/llvm/llvm-project/pull/100439

>From b4af3e9f4ece748a44b097a3caba75b156fceb80 Mon Sep 17 00:00:00 2001
From: Advenam Tacet <advenam.tacet at gmail.com>
Date: Wed, 24 Jul 2024 19:53:13 +0200
Subject: [PATCH 1/6] just testing for PR 94103

---
 .../asan/TestCases/contiguous_container_crash.cpp     | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp b/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
index 41fb2d61a3dec..7ead3d893d2f7 100644
--- a/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
+++ b/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
@@ -1,6 +1,7 @@
 // RUN: %clangxx_asan -O %s -o %t
 // RUN: not %run %t crash 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
 // RUN: not %run %t bad-bounds 2>&1 | FileCheck --check-prefix=CHECK-BAD-BOUNDS %s
+// RUN: not %run %t unaligned-bad-bounds 2>&1 | FileCheck --check-prefix=CHECK-UNALIGNED-BAD-BOUNDS %s
 // RUN: not %run %t odd-alignment 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
 // RUN: not %run %t odd-alignment-end 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
 // RUN: %env_asan_opts=detect_container_overflow=0 %run %t crash
@@ -35,6 +36,14 @@ void BadBounds() {
                                             &t[0] + 50);
 }
 
+void UnalignedBadBounds() {
+  char t[100];
+// CHECK-UNALIGNED-BAD-BOUNDS-NOT: beg is not aligned by
+// CHECK-UNALIGNED-BAD-BOUNDS: ERROR: AddressSanitizer: bad parameters to __sanitizer_annotate_contiguous_container
+  __sanitizer_annotate_contiguous_container(&t[1], &t[0] + 100, &t[0] + 101,
+                                            &t[0] + 50);
+}
+
 int OddAlignment() {
   int t[100];
   t[60] = 0;
@@ -57,6 +66,8 @@ int main(int argc, char **argv) {
     return TestCrash();
   else if (!strcmp(argv[1], "bad-bounds"))
     BadBounds();
+  else if (!strcmp(argv[1], "unaligned-bad-bounds"))
+    UnalignedBadBounds();
   else if (!strcmp(argv[1], "odd-alignment"))
     return OddAlignment();
   else if (!strcmp(argv[1], "odd-alignment-end"))

>From 8ce5541703ec7e1c6d499f5512e3b44c96e556a1 Mon Sep 17 00:00:00 2001
From: Advenam Tacet <advenam.tacet at gmail.com>
Date: Wed, 31 Jul 2024 02:12:36 +0200
Subject: [PATCH 2/6] fixing formatting

---
 .../test/asan/TestCases/contiguous_container_crash.cpp        | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp b/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
index 7ead3d893d2f7..0dd5e57e29332 100644
--- a/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
+++ b/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
@@ -38,8 +38,8 @@ void BadBounds() {
 
 void UnalignedBadBounds() {
   char t[100];
-// CHECK-UNALIGNED-BAD-BOUNDS-NOT: beg is not aligned by
-// CHECK-UNALIGNED-BAD-BOUNDS: ERROR: AddressSanitizer: bad parameters to __sanitizer_annotate_contiguous_container
+  // CHECK-UNALIGNED-BAD-BOUNDS-NOT: beg is not aligned by
+  // CHECK-UNALIGNED-BAD-BOUNDS: ERROR: AddressSanitizer: bad parameters to __sanitizer_annotate_contiguous_container
   __sanitizer_annotate_contiguous_container(&t[1], &t[0] + 100, &t[0] + 101,
                                             &t[0] + 50);
 }

>From 594d86ea874cc64913fa337d3fa2fc6bd51f29cc Mon Sep 17 00:00:00 2001
From: Tacet <advenam.tacet at gmail.com>
Date: Wed, 31 Jul 2024 15:18:05 +0200
Subject: [PATCH 3/6] Update
 compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp

---
 compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp b/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
index 0dd5e57e29332..d31446ea4a717 100644
--- a/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
+++ b/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
@@ -1,7 +1,7 @@
 // RUN: %clangxx_asan -O %s -o %t
 // RUN: not %run %t crash 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
 // RUN: not %run %t bad-bounds 2>&1 | FileCheck --check-prefix=CHECK-BAD-BOUNDS %s
-// RUN: not %run %t unaligned-bad-bounds 2>&1 | FileCheck --check-prefix=CHECK-UNALIGNED-BAD-BOUNDS %s
+// RUN: not %run %t unaligned-bad-bounds 2>&1 | FileCheck --check-prefix=CHECK-UNALIGNED-BAD-BOUNDS,CHECK-UNALIGNED-BAD-BOUNDS-NOT %s
 // RUN: not %run %t odd-alignment 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
 // RUN: not %run %t odd-alignment-end 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
 // RUN: %env_asan_opts=detect_container_overflow=0 %run %t crash

>From 96986e130918bfe67846b62d42945e42bd89f1e8 Mon Sep 17 00:00:00 2001
From: Advenam Tacet <advenam.tacet at gmail.com>
Date: Wed, 31 Jul 2024 15:37:04 +0200
Subject: [PATCH 4/6] only one not

---
 compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp b/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
index d31446ea4a717..698e75e0324d3 100644
--- a/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
+++ b/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
@@ -1,7 +1,7 @@
 // RUN: %clangxx_asan -O %s -o %t
 // RUN: not %run %t crash 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
 // RUN: not %run %t bad-bounds 2>&1 | FileCheck --check-prefix=CHECK-BAD-BOUNDS %s
-// RUN: not %run %t unaligned-bad-bounds 2>&1 | FileCheck --check-prefix=CHECK-UNALIGNED-BAD-BOUNDS,CHECK-UNALIGNED-BAD-BOUNDS-NOT %s
+// RUN: not %run %t unaligned-bad-bounds 2>&1 | FileCheck --check-prefix=CHECK-UNALIGNED-BAD-BOUNDS-NOT %s
 // RUN: not %run %t odd-alignment 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
 // RUN: not %run %t odd-alignment-end 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
 // RUN: %env_asan_opts=detect_container_overflow=0 %run %t crash
@@ -39,7 +39,6 @@ void BadBounds() {
 void UnalignedBadBounds() {
   char t[100];
   // CHECK-UNALIGNED-BAD-BOUNDS-NOT: beg is not aligned by
-  // CHECK-UNALIGNED-BAD-BOUNDS: ERROR: AddressSanitizer: bad parameters to __sanitizer_annotate_contiguous_container
   __sanitizer_annotate_contiguous_container(&t[1], &t[0] + 100, &t[0] + 101,
                                             &t[0] + 50);
 }

>From cfeb3c10dc0e21ae818f3df2769ad9a0bdea1f74 Mon Sep 17 00:00:00 2001
From: Advenam Tacet <advenam.tacet at gmail.com>
Date: Wed, 31 Jul 2024 15:50:41 +0200
Subject: [PATCH 5/6] remove indent

---
 compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp b/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
index 698e75e0324d3..51cb615877bd0 100644
--- a/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
+++ b/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
@@ -38,7 +38,7 @@ void BadBounds() {
 
 void UnalignedBadBounds() {
   char t[100];
-  // CHECK-UNALIGNED-BAD-BOUNDS-NOT: beg is not aligned by
+// CHECK-UNALIGNED-BAD-BOUNDS-NOT: beg is not aligned by
   __sanitizer_annotate_contiguous_container(&t[1], &t[0] + 100, &t[0] + 101,
                                             &t[0] + 50);
 }

>From a7b6ca3e6c1710e1777dc4c38dc0bfc61c801f23 Mon Sep 17 00:00:00 2001
From: Advenam Tacet <advenam.tacet at gmail.com>
Date: Wed, 31 Jul 2024 18:19:49 +0200
Subject: [PATCH 6/6] no NOT in run rule

---
 compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp b/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
index 51cb615877bd0..061b798632c94 100644
--- a/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
+++ b/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
@@ -1,7 +1,7 @@
 // RUN: %clangxx_asan -O %s -o %t
 // RUN: not %run %t crash 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
 // RUN: not %run %t bad-bounds 2>&1 | FileCheck --check-prefix=CHECK-BAD-BOUNDS %s
-// RUN: not %run %t unaligned-bad-bounds 2>&1 | FileCheck --check-prefix=CHECK-UNALIGNED-BAD-BOUNDS-NOT %s
+// RUN: not %run %t unaligned-bad-bounds 2>&1 | FileCheck --check-prefix=CHECK-UNALIGNED-BAD-BOUNDS %s
 // RUN: not %run %t odd-alignment 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
 // RUN: not %run %t odd-alignment-end 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
 // RUN: %env_asan_opts=detect_container_overflow=0 %run %t crash



More information about the llvm-commits mailing list