The test was checking that we can print an error message when a variable
is optimized away, but the optimizer got smarter (D140404) in tracking
the variable's value (so that we were not able to recover its value).
Using a value in an argument registers (argc) makes it more likely to be
overwritten by subsequent function calls (and permanently lost).
self.assertEqual(len(breakpoint_ids), len(lines),
"expect correct number of breakpoints")
self.continue_to_breakpoints(breakpoint_ids)
- optimized_variable = self.vscode.get_local_variable('optimized')
+ optimized_variable = self.vscode.get_local_variable('argc')
self.assertTrue(optimized_variable['value'].startswith('<error:'))
}
int main(int argc, char const *argv[]) {
- int optimized = argc > 1 ? std::stoi(argv[1]) : 0;
-
- printf("argc: %d, optimized: %d\n", argc, optimized);
- int result = foo(argc, 20);
+ printf("argc: %d\n", argc);
+ int result = foo(20, argv[0][0]);
printf("result: %d\n", result); // breakpoint 2
return 0;
}