Chromium Code Reviews| Index: tests_lit/asan_tests/realloc_shrink.ll |
| diff --git a/tests_lit/asan_tests/realloc_shrink.ll b/tests_lit/asan_tests/realloc_shrink.ll |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..599a6cf7dd62f8aca79bca024330801c1123efca |
| --- /dev/null |
| +++ b/tests_lit/asan_tests/realloc_shrink.ll |
| @@ -0,0 +1,26 @@ |
| +; Test that shrinking an allocation updates the redzones |
| + |
| +; REQUIRES: no_minimal_build |
| + |
| +; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \ |
| +; RUN: --fsanitize-address --sz="-allow-externally-defined-symbols" \ |
|
Jim Stichnoth
2016/07/21 01:42:09
You don't really need the double-quotes here.
|
| +; RUN: %t.pexe -o %t && %t 2>&1 | FileCheck %s |
| + |
| + |
| +declare external i32 @malloc(i32) |
| +declare external i32 @realloc(i32, i32) |
| +declare external void @free(i32) |
| + |
| +define void @_start(i32 %arg) { |
| + %ptr16 = call i32 @malloc(i32 16) |
| + %off12a = add i32 %ptr16, 12 |
| + %offptra = inttoptr i32 %off12a to i32* |
| + %resa = load i32, i32* %offptra, align 1 |
| + %ptr8 = call i32 @realloc(i32 %ptr16, i32 8) |
| + %off12b = add i32 %ptr8, 12 |
| + %offptrb = inttoptr i32 %off12b to i8* |
| + %resb = load i8, i8* %offptrb, align 1 |
| + ret void |
| +} |
| + |
| +; CHECK: Illegal access of 1 bytes at |
|
Jim Stichnoth
2016/07/21 01:42:09
"1 bytes" :)
(never mind...)
|