repo.or.cz
/
llvm-project.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git]
/
compiler-rt
/
test
/
sanitizer_common
/
TestCases
/
Posix
/
wcsdup.c
blob
e26aad855621c37352d50cdc6a1ee9771be914df
1
// RUN: %clang %s -o %t && %run %t 2>&1
2
3
#include <assert.h>
4
#include <stdlib.h>
5
#include <wchar.h>
6
7
int
main
(
int
argc
,
char
**
argv
) {
8
wchar_t
*
buff
=
wcsdup
(
L
"foo"
);
9
assert
(
buff
[
0
] ==
L
'f'
);
10
assert
(
buff
[
1
] ==
L
'o'
);
11
assert
(
buff
[
2
] ==
L
'o'
);
12
assert
(
buff
[
3
] ==
L
'\0'
);
13
free
(
buff
);
14
return
0
;
15
}