1// Helper binary for
2// lit_tests/TestCases/Darwin/unset-insert-libraries-on-exec.cpp
3// Prints the environment variable with the given name.
4#include <stdio.h>
5#include <stdlib.h>
6
7int main(int argc, char *argv[]) {
8 if (argc != 2) {
9 printf(format: "Usage: %s ENVNAME\n", argv[0]);
10 exit(status: 1);
11 }
12 const char *value = getenv(name: argv[1]);
13 if (value) {
14 printf(format: "%s = %s\n", argv[1], value);
15 } else {
16 printf(format: "%s not set.\n", argv[1]);
17 }
18 return 0;
19}
20

source code of compiler-rt/test/asan/TestCases/Helpers/echo-env.cpp