aboutsummaryrefslogtreecommitdiff
path: root/test/msan/dlerror.cc
blob: d5510b65c4a5b04f88d4692a4d3b29c1bc26b334 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// RUN: %clangxx_msan -O0 %s -o %t && %run %t

#include <assert.h>
#include <dlfcn.h>
#include <stdio.h>
#include <string.h>

int main(void) {
  void *p = dlopen("/bad/file/name", RTLD_NOW);
  assert(!p);
  char *s = dlerror();
  printf("%s, %zu\n", s, strlen(s));
  return 0;
}