mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 15:11:24 +00:00
Added test for non-static use of cl::opt (fixed in r160170)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161751 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
88fc697b7c
commit
8932fe4d2b
@ -55,6 +55,17 @@ TEST(CommandLineTest, ParseEnvironment) {
|
||||
EXPECT_EQ("hello", EnvironmentTestOption);
|
||||
}
|
||||
|
||||
// This test used to make valgrind complain
|
||||
// ("Conditional jump or move depends on uninitialised value(s)")
|
||||
TEST(CommandLineTest, ParseEnvironmentToLocalVar) {
|
||||
// Put cl::opt on stack to check for proper initialization of fields.
|
||||
cl::opt<std::string> EnvironmentTestOptionLocal("env-test-opt-local");
|
||||
TempEnvVar TEV(test_env_var, "-env-test-opt-local=hello-local");
|
||||
EXPECT_EQ("", EnvironmentTestOptionLocal);
|
||||
cl::ParseEnvironmentOptions("CommandLineTest", test_env_var);
|
||||
EXPECT_EQ("hello-local", EnvironmentTestOptionLocal);
|
||||
}
|
||||
|
||||
#endif // SKIP_ENVIRONMENT_TESTS
|
||||
|
||||
} // anonymous namespace
|
||||
|
Loading…
Reference in New Issue
Block a user