aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Govostes <rzg@apple.com>2016-06-23 23:26:25 +0000
committerRyan Govostes <rzg@apple.com>2016-06-23 23:26:25 +0000
commit0ec8ab680fe9696c4bb69c945e3d0271b8dfef6c (patch)
treee81e8ed4bcdabf928b527830a3c4259067bda540
parent14416ae6cdb3c15fbe054682e803080969165379 (diff)
downloadllvm-0ec8ab680fe9696c4bb69c945e3d0271b8dfef6c.zip
llvm-0ec8ab680fe9696c4bb69c945e3d0271b8dfef6c.tar.gz
llvm-0ec8ab680fe9696c4bb69c945e3d0271b8dfef6c.tar.bz2
[asan] Add failure logging to global-registration.c test case
llvm-svn: 273629
-rw-r--r--compiler-rt/test/asan/TestCases/Posix/global-registration.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/compiler-rt/test/asan/TestCases/Posix/global-registration.c b/compiler-rt/test/asan/TestCases/Posix/global-registration.c
index 36f0ab5..95e8eac 100644
--- a/compiler-rt/test/asan/TestCases/Posix/global-registration.c
+++ b/compiler-rt/test/asan/TestCases/Posix/global-registration.c
@@ -16,6 +16,7 @@
#if MAIN_FILE
#include <dlfcn.h>
+#include <stdio.h>
#include <stdlib.h>
extern char buffer2[1];
@@ -31,12 +32,16 @@ int main(int argc, char *argv[]) {
// ASAN-CHECK-2: {{0x.* is located 1 bytes .* 'buffer2'}}
} else if (n == 3) {
void *handle = dlopen(DYNAMICLIB, RTLD_NOW);
- if (!handle)
+ if (!handle) {
+ fprintf(stderr, "dlopen: %s\n", dlerror());
return 1;
+ }
char *buffer = (char *)dlsym(handle, "buffer3");
- if (!buffer)
+ if (!buffer) {
+ fprintf(stderr, "dlsym: %s\n", dlerror());
return 1;
+ }
buffer[argc] = 0;
// ASAN-CHECK-3: {{0x.* is located 1 bytes .* 'buffer3'}}