Skip to content

Commit ffaad73

Browse files
committed
just testing for llvm#94103
1 parent 25f0381 commit ffaad73

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// RUN: %clangxx_asan -O %s -o %t
22
// RUN: not %run %t crash 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
33
// RUN: not %run %t bad-bounds 2>&1 | FileCheck --check-prefix=CHECK-BAD-BOUNDS %s
4+
// RUN: not %run %t unaligned-bad-bounds 2>&1 | FileCheck --check-prefix=CHECK-UNALIGNED-BAD-BOUNDS %s
45
// RUN: not %run %t odd-alignment 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
56
// RUN: not %run %t odd-alignment-end 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
67
// RUN: %env_asan_opts=detect_container_overflow=0 %run %t crash
@@ -35,6 +36,14 @@ void BadBounds() {
3536
&t[0] + 50);
3637
}
3738

39+
void UnalignedBadBounds() {
40+
long t[100];
41+
// CHECK-UNALIGNED-BAD-BOUNDS: ERROR: AddressSanitizer: bad parameters to __sanitizer_annotate_contiguous_container
42+
// CHECK-UNALIGNED-BAD-BOUNDS-NOT: beg is not aligned by
43+
__sanitizer_annotate_contiguous_container(&t[1], &t[0] + 100, &t[0] + 101,
44+
&t[0] + 50);
45+
}
46+
3847
int OddAlignment() {
3948
int t[100];
4049
t[60] = 0;
@@ -57,6 +66,8 @@ int main(int argc, char **argv) {
5766
return TestCrash();
5867
else if (!strcmp(argv[1], "bad-bounds"))
5968
BadBounds();
69+
else if (!strcmp(argv[1], "unaligned-bad-bounds"))
70+
UnalignedBadBounds();
6071
else if (!strcmp(argv[1], "odd-alignment"))
6172
return OddAlignment();
6273
else if (!strcmp(argv[1], "odd-alignment-end"))

0 commit comments

Comments
 (0)