| 1 | // RUN: %clang %s -o %t && %run %t 2>&1 |
|---|---|
| 2 | |
| 3 | #include <assert.h> |
| 4 | #include <stdlib.h> |
| 5 | |
| 6 | int main(int argc, char **argv) { |
| 7 | char buff[10]; |
| 8 | wchar_t x = L'a'; |
| 9 | wctomb(NULL, wchar: x); |
| 10 | int res = wctomb(s: buff, wchar: x); |
| 11 | assert(res == 1); |
| 12 | assert(buff[0] == 'a'); |
| 13 | return 0; |
| 14 | } |
| 15 |
