]> git.proxmox.com Git - rustc.git/blame - src/compiler-rt/test/asan/TestCases/Helpers/echo-env.cc
New upstream version 1.19.0+dfsg3
[rustc.git] / src / compiler-rt / test / asan / TestCases / Helpers / echo-env.cc
CommitLineData
1a4d82fc
JJ
1// Helper binary for
2// lit_tests/TestCases/Darwin/unset-insert-libraries-on-exec.cc
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("Usage: %s ENVNAME\n", argv[0]);
10 exit(1);
11 }
12 const char *value = getenv(argv[1]);
13 if (value) {
14 printf("%s = %s\n", argv[1], value);
15 } else {
16 printf("%s not set.\n", argv[1]);
17 }
18 return 0;
19}