summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/sanitizer_common/TestCases/Posix/wcsdup.c
blob: e26aad855621c37352d50cdc6a1ee9771be914df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// RUN: %clang %s -o %t && %run %t 2>&1

#include <assert.h>
#include <stdlib.h>
#include <wchar.h>

int main(int argc, char **argv) {
  wchar_t *buff = wcsdup(L"foo");
  assert(buff[0] == L'f');
  assert(buff[1] == L'o');
  assert(buff[2] == L'o');
  assert(buff[3] == L'\0');
  free(buff);
  return 0;
}
OpenPOWER on IntegriCloud