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

Unified Diff: tests_lit/asan_tests/calloc.ll

Issue 2145213002: Subzero: implemented wrapper script to replace calls to calloc() (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addressed comments and added error testing Created 4 years, 5 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
Index: tests_lit/asan_tests/calloc.ll
diff --git a/tests_lit/asan_tests/calloc.ll b/tests_lit/asan_tests/calloc.ll
new file mode 100644
index 0000000000000000000000000000000000000000..a6d7c4c6cf9578e4ce2dce9fcf7f42e79920a580
--- /dev/null
+++ b/tests_lit/asan_tests/calloc.ll
@@ -0,0 +1,14 @@
+; Test that sz-clang.py and sz-clang++.py successfully replace calls to calloc
+
+; RUN: %S/../../pydir/sz-clang.py -fsanitize-address %S/Input/calloc.c -E \
+; RUN: | FileCheck %s
+
+; RUN: %S/../../pydir/sz-clang++.py -fsanitize-address %S/Input/calloc.c -E \
+; RUN: | FileCheck %s
+
+; CHECK-LABEL: int main(void) {
+; CHECK-NEXT: void *buf = (__asan_dummy_calloc(14, sizeof(int)));
+; CHECK-NEXT: strcpy(buf, "Hello, world!");
+; CHECK-NEXT: printf("%s\n", buf);
+; CHECK-NEXT: free(buf);
+; CHECK-NEXT: }

Powered by Google App Engine
This is Rietveld 408576698