[compiler-rt] r273629 - [asan] Add failure logging to global-registration.c test case
Ryan Govostes via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 23 16:26:26 PDT 2016
Author: rgov
Date: Thu Jun 23 18:26:25 2016
New Revision: 273629
URL: http://llvm.org/viewvc/llvm-project?rev=273629&view=rev
Log:
[asan] Add failure logging to global-registration.c test case
Modified:
compiler-rt/trunk/test/asan/TestCases/Posix/global-registration.c
Modified: compiler-rt/trunk/test/asan/TestCases/Posix/global-registration.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Posix/global-registration.c?rev=273629&r1=273628&r2=273629&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Posix/global-registration.c (original)
+++ compiler-rt/trunk/test/asan/TestCases/Posix/global-registration.c Thu Jun 23 18:26:25 2016
@@ -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'}}
More information about the llvm-commits
mailing list