Differentiate stacktrace_from_current_z_* from the non-z versions in another test so they aren't merged during LTO/ICF, related to #179
This commit is contained in:
parent
0d53defcd9
commit
81d4776a22
@ -16,16 +16,22 @@ using namespace std::literals;
|
||||
// NOTE: returning something and then return stacktrace_from_current_3(line_numbers) * 2; later helps prevent the call from
|
||||
// being optimized to a jmp
|
||||
CPPTRACE_FORCE_NO_INLINE int stacktrace_from_current_z_3(std::vector<int>& line_numbers) {
|
||||
// just here to differentiate from the non-z version to prevent ICF if LTO is being used
|
||||
[[maybe_unused]] volatile int x = 1;
|
||||
line_numbers.insert(line_numbers.begin(), __LINE__ + 1);
|
||||
throw std::runtime_error("foobar");
|
||||
}
|
||||
|
||||
CPPTRACE_FORCE_NO_INLINE int stacktrace_from_current_z_2(std::vector<int>& line_numbers) {
|
||||
// just here to differentiate from the non-z version to prevent ICF if LTO is being used
|
||||
[[maybe_unused]] volatile int x = 1;
|
||||
line_numbers.insert(line_numbers.begin(), __LINE__ + 1);
|
||||
return stacktrace_from_current_z_3(line_numbers) * 2;
|
||||
}
|
||||
|
||||
CPPTRACE_FORCE_NO_INLINE int stacktrace_from_current_z_1(std::vector<int>& line_numbers) {
|
||||
// just here to differentiate from the non-z version to prevent ICF if LTO is being used
|
||||
[[maybe_unused]] volatile int x = 1;
|
||||
line_numbers.insert(line_numbers.begin(), __LINE__ + 1);
|
||||
return stacktrace_from_current_z_2(line_numbers) * 2;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user