C++: Add pointer/pointee conflation test.

This commit is contained in:
Mathias Vorreiter Pedersen
2024-01-10 11:51:40 +00:00
parent c9cf2a899c
commit 259bf27334
4 changed files with 21 additions and 0 deletions

View File

@@ -922,4 +922,18 @@ namespace GlobalArrays {
sink(global_pointer_static_indirect_2); // clean: global_pointer_static_indirect_2 does not have 2 indirections
indirect_sink(global_pointer_static_indirect_2); // clean: global_pointer_static_indirect_2 does not have 2 indirections
}
}
namespace global_variable_conflation_test {
int* global_pointer;
void def() {
global_pointer = nullptr;
*global_pointer = source();
}
void use() {
sink(global_pointer); // $ SPURIOUS: ir
sink(*global_pointer); // $ ir MISSING: ast
}
}