1 // RUN: %clang -O0 %s -o %t && %run %t
11 int main(int argc
, char **argv
) {
12 char symlink_path
[PATH_MAX
];
13 snprintf(symlink_path
, sizeof(symlink_path
), "%s_%d.symlink", argv
[0],
16 int res
= symlink(argv
[0], symlink_path
);
19 char readlink_path
[PATH_MAX
];
20 ssize_t res2
= readlink(symlink_path
, readlink_path
, sizeof(readlink_path
));
22 readlink_path
[res2
] = '\0';
23 assert(!strcmp(readlink_path
, argv
[0]));