C++: Add pointer/pointee conflation test.

This commit is contained in:
Mathias Vorreiter Pedersen
2025-01-17 21:03:44 +00:00
parent d8ec6dd155
commit 9970f7837b
3 changed files with 18 additions and 0 deletions

View File

@@ -185,6 +185,8 @@ postWithInFlow
| test.cpp:1138:5:1138:8 | data [inner post update] | PostUpdateNode should not be the target of local flow. |
| test.cpp:1139:3:1139:7 | * ... [post update] | PostUpdateNode should not be the target of local flow. |
| test.cpp:1139:4:1139:7 | data [inner post update] | PostUpdateNode should not be the target of local flow. |
| test.cpp:1153:5:1153:6 | * ... [post update] | PostUpdateNode should not be the target of local flow. |
| test.cpp:1153:6:1153:6 | p [inner post update] | PostUpdateNode should not be the target of local flow. |
viableImplInCallContextTooLarge
uniqueParameterNodeAtPosition
uniqueParameterNodePosition

View File

@@ -327,6 +327,7 @@ irFlow
| test.cpp:1117:27:1117:34 | call to source | test.cpp:1117:27:1117:34 | call to source |
| test.cpp:1132:11:1132:16 | call to source | test.cpp:1121:8:1121:8 | x |
| test.cpp:1138:17:1138:22 | call to source | test.cpp:1140:8:1140:18 | * ... |
| test.cpp:1153:10:1153:15 | call to source | test.cpp:1148:10:1148:12 | * ... |
| true_upon_entry.cpp:9:11:9:16 | call to source | true_upon_entry.cpp:13:8:13:8 | x |
| true_upon_entry.cpp:17:11:17:16 | call to source | true_upon_entry.cpp:21:8:21:8 | x |
| true_upon_entry.cpp:27:9:27:14 | call to source | true_upon_entry.cpp:29:8:29:8 | x |

View File

@@ -1138,4 +1138,19 @@ void test_uncertain_array(int n1, int n2) {
*(data + 1) = source();
*data = 0;
sink(*(data + 1)); // $ ast=1138:17 ast=1137:7 ir
}
namespace conflation_regression {
char* source(int);
void read_deref_deref(char **l) { // $ ast-def=l ir-def=*l ir-def=**l
sink(**l); // $ SPURIOUS: ir
}
void f(char ** p) // $ ast-def=p ir-def=*p ir-def=**p
{
*p = source(0);
read_deref_deref(p);
}
}