aboutsummaryrefslogtreecommitdiff
path: root/test/sanitizer_common/TestCases/Posix/wcsxfrm.c
blob: 3e349c75f40900f436112393a94e4a944ada9a92 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// RUN: %clang -O0 %s -o %t && %run %t
// UNSUPPORTED: darwin

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

int main(int argc, char **argv) {
  wchar_t q[10];
  size_t n = wcsxfrm(q, L"abcdef", sizeof(q) / sizeof(wchar_t));
  assert(n < sizeof(q));

  wchar_t q2[10];
  locale_t loc = newlocale(LC_ALL_MASK, "", (locale_t)0);
  n = wcsxfrm_l(q2, L"qwerty", sizeof(q) / sizeof(wchar_t), loc);
  assert(n < sizeof(q2));

  freelocale(loc);
  return 0;
}