-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmain.cpp
53 lines (42 loc) · 1.18 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <cstdio>
#include <cstdlib>
#include "gtest/gtest.h"
#include "codegen_context.hpp"
#include "test_util_helper.h"
bool g_is_update_expected_mode = false;
namespace {
void PrintInformation()
{
#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
printf("--------------- General Information ---------------\n");
printf("Host: ");
fflush(stdout);
std::ignore = system("whoami | tr -d '\\n' && printf '@' && cat /etc/hostname");
printf("Build flavor: %s\n", TOSTRING(BUILD_FLAVOR));
printf("---------------------------------------------------\n");
#undef TOSTRING
#undef STRINGIFY
}
} // annoymous namespace
int main(int argc, char **argv)
{
PrintInformation();
llvm::InitLLVM X(argc, argv);
llvm::InitializeNativeTarget();
llvm::InitializeNativeTargetAsmPrinter();
::testing::InitGoogleTest(&argc, argv);
for (int i = 1; i < argc; i++)
{
if (strcmp(argv[i], "--update-expected") == 0)
{
g_is_update_expected_mode = true;
}
else
{
printf("Unknown command-line argument: %s\n", argv[i]);
ReleaseAssert(false);
}
}
return RUN_ALL_TESTS();
}