[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / compiler-rt / test / sanitizer_common / TestCases / Linux / ptsname.c
blob8fa1d370129688ce676d380bedea6aebaaa4a4c0
1 // RUN: %clang %s -o %t && %run %t
3 #define _GNU_SOURCE
4 #define _XOPEN_SOURCE 600
6 #include <assert.h>
7 #include <fcntl.h>
8 #include <stdlib.h>
9 #include <string.h>
10 #include <unistd.h>
12 int main() {
13 int pt = posix_openpt(O_NOCTTY);
14 if (pt == -1)
15 return 0;
16 char *s = ptsname(pt);
17 assert(s);
18 assert(strstr(s, "/dev"));
20 char buff[1000] = {};
21 int r = ptsname_r(pt, buff, sizeof(buff));
22 assert(!r);
23 assert(strstr(buff, "/dev"));
25 close(pt);
26 return 0;