C++: Add testcase demonstrating that the model for 'strncpy' is broken.

This commit is contained in:
Mathias Vorreiter Pedersen
2023-06-18 13:12:23 +01:00
parent ff3c76c1fa
commit 273e5bc21f
2 changed files with 22 additions and 0 deletions

View File

@@ -702,4 +702,12 @@ namespace strings {
*p++ = *s;
sink(p); // $ ast ir
}
}
char * strncpy (char *, const char *, unsigned long);
void test_strncpy(char* d, char* s) {
argument_source(s);
strncpy(d, s, 16);
sink(d); // $ ast MISSING: ir
}