[AMDGPU] Add True16 register classes.
[llvm-project.git] / lldb / test / API / commands / settings / main.cpp
blobe18f0ae52a9b1da7c383f5679c57b0ec7f731ba7
1 #include <cstdlib>
2 #include <string>
3 #include <fstream>
4 #include <iostream>
6 int numberfn()
8 return 0x5a;
11 int
12 main(int argc, char const *argv[])
14 // The program writes its output to the following file:
16 // o "output1.txt" for test_pass_host_env_vars() test case
17 // o "output2.txt" for test_run_args_and_env_vars_with_dsym() test case
18 // o "output2.txt" for test_run_args_and_env_vars_with_dwarf() test case
19 std::ofstream outfile;
20 if (argc == 1)
21 outfile.open("output1.txt");
22 else
23 outfile.open("output2.txt");
25 for (unsigned i = 0; i < argc; ++i) {
26 std::string theArg(argv[i]);
27 if (i == 1 && "A" == theArg)
28 outfile << "argv[1] matches\n";
30 if (i == 2 && "B" == theArg)
31 outfile << "argv[2] matches\n";
33 if (i == 3 && "C" == theArg)
34 outfile << "argv[3] matches\n";
37 // For passing environment vars from the debugger to the launched process.
38 if (::getenv("MY_ENV_VAR")) {
39 std::string MY_ENV_VAR(getenv("MY_ENV_VAR"));
40 if ("YES" == MY_ENV_VAR) {
41 outfile << "Environment variable 'MY_ENV_VAR' successfully passed.\n";
46 // For passing host environment vars to the launched process.
47 if (::getenv("MY_HOST_ENV_VAR1")) {
48 std::string MY_HOST_ENV_VAR1(getenv("MY_HOST_ENV_VAR1"));
49 if ("VAR1" == MY_HOST_ENV_VAR1) {
50 outfile << "The host environment variable 'MY_HOST_ENV_VAR1' successfully passed.\n";
54 if (::getenv("MY_HOST_ENV_VAR2")) {
55 std::string MY_HOST_ENV_VAR2(getenv("MY_HOST_ENV_VAR2"));
56 if ("VAR2" == MY_HOST_ENV_VAR2) {
57 outfile << "The host environment variable 'MY_HOST_ENV_VAR2' successfully passed.\n";
61 std::cerr << "This message should go to standard error.\n";
62 std::cout << "This message should go to standard out.\n";
64 outfile.close();
65 return numberfn();