bolt/deps/llvm-18.1.8/compiler-rt/test/sanitizer_common/TestCases/Posix/realpath.cpp

22 lines
525 B
C++
Raw Normal View History

2025-02-14 19:21:04 +01:00
// RUN: %clangxx -O0 %s -o %t && %run %t m1 2>&1 | FileCheck %s
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
char buff[1 << 12];
int main(int argc, char *argv[]) {
printf("REALPATH %s\n", realpath(argv[0], buff));
// CHECK: REALPATH /{{.+}}/realpath.cpp
char *buff2 = realpath(argv[0], nullptr);
printf("REALPATH %s\n", buff2);
// CHECK: REALPATH /{{.+}}/realpath.cpp
free(buff2);
buff2 = realpath(".", nullptr);
printf("REALPATH %s\n", buff2);
// CHECK: REALPATH /{{.+}}
free(buff2);
}