1 // RUN: %clang -O0 %s -o %t && %run %t
3 // XFAIL: i386-netbsd && asan
12 int main(int argc
, char **argv
) {
13 char symlink_path
[PATH_MAX
];
14 snprintf(symlink_path
, sizeof(symlink_path
), "%s_%d.symlink", argv
[0],
17 int res
= symlink(argv
[0], symlink_path
);
20 char readlinkat_path
[PATH_MAX
];
21 int res2
= readlinkat(AT_FDCWD
, symlink_path
, readlinkat_path
,
22 sizeof(readlinkat_path
));
24 readlinkat_path
[res2
] = '\0';
25 assert(!strcmp(readlinkat_path
, argv
[0]));