Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(236)

Unified Diff: tests_lit/asan_tests/doublefree.ll

Issue 2227353002: Subzero: Added ASan quarantine for recently freed objects (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Added check for double free errors Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/szrt_asan.c ('k') | tests_lit/asan_tests/quarantine.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests_lit/asan_tests/doublefree.ll
diff --git a/tests_lit/asan_tests/doublefree.ll b/tests_lit/asan_tests/doublefree.ll
new file mode 100644
index 0000000000000000000000000000000000000000..ca79ec41567d3111f72e9589ae61c37653881989
--- /dev/null
+++ b/tests_lit/asan_tests/doublefree.ll
@@ -0,0 +1,24 @@
+; Test that double frees are detected
+
+; 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 \
+; RUN: %t.pexe -o %t && %t 2>&1 | FileCheck --check-prefix=ERR %s
+; RUN: llvm-as %s -o - | pnacl-freeze > %t.pexe && %S/../../pydir/szbuild.py \
+; RUN: --fsanitize-address --sz=-allow-externally-defined-symbols -O2 \
+; RUN: %t.pexe -o %t && %t 2>&1 | FileCheck --check-prefix=ERR %s
+
+declare external i32 @malloc(i32)
+declare external void @free(i32)
+declare external void @exit(i32)
+
+define void @_start(i32 %arg) {
+ %alloc = call i32 @malloc(i32 42)
+ call void @free(i32 %alloc)
+ call void @free(i32 %alloc)
+ call void @exit(i32 1)
+ ret void
+}
+
+; ERR: Double free of object at
« no previous file with comments | « runtime/szrt_asan.c ('k') | tests_lit/asan_tests/quarantine.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698