C++: Add aggregate literals to sideEffects test

This commit is contained in:
Ian Lynagh
2019-09-24 11:23:27 +01:00
parent b85896299d
commit 49276e09c5
2 changed files with 38 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
void f1(int p) {
int f1(int p) {
int i;
for (
@@ -11,3 +11,20 @@ void f1(int p) {
return p;
}
int global_int;
int f2(void) {
global_int = 3;
return 1;
}
int f3(void) {
return 2;
}
void f4(void) {
int is0[3] = { 3, 4, 5 };
int is1[3] = { 3, f2(), 5 };
int is2[3] = { 3, f3(), 5 };
}

View File

@@ -10,6 +10,26 @@
| exprs.c:9:3:9:5 | ++ ... | | mayBeImpure | |
| exprs.c:9:5:9:5 | p | isPure | | |
| exprs.c:12:12:12:12 | p | isPure | | |
| exprs.c:18:5:18:14 | global_int | isPure | | |
| exprs.c:18:5:18:18 | ... = ... | | mayBeImpure | mayBeGloballyImpure |
| exprs.c:18:18:18:18 | 3 | isPure | | |
| exprs.c:19:12:19:12 | 1 | isPure | | |
| exprs.c:23:12:23:12 | 2 | isPure | | |
| exprs.c:27:13:27:13 | 3 | isPure | | |
| exprs.c:27:17:27:28 | {...} | isPure | | |
| exprs.c:27:20:27:20 | 3 | isPure | | |
| exprs.c:27:23:27:23 | 4 | isPure | | |
| exprs.c:27:26:27:26 | 5 | isPure | | |
| exprs.c:28:13:28:13 | 3 | isPure | | |
| exprs.c:28:17:28:31 | {...} | | mayBeImpure | mayBeGloballyImpure |
| exprs.c:28:20:28:20 | 3 | isPure | | |
| exprs.c:28:23:28:24 | call to f2 | | mayBeImpure | mayBeGloballyImpure |
| exprs.c:28:29:28:29 | 5 | isPure | | |
| exprs.c:29:13:29:13 | 3 | isPure | | |
| exprs.c:29:17:29:31 | {...} | isPure | | |
| exprs.c:29:20:29:20 | 3 | isPure | | |
| exprs.c:29:23:29:24 | call to f3 | isPure | | |
| exprs.c:29:29:29:29 | 5 | isPure | | |
| exprs.cpp:7:10:7:16 | (...) | isPure | | |
| exprs.cpp:7:10:7:16 | (reference to) | isPure | | |
| exprs.cpp:7:11:7:15 | * ... | isPure | | |