Commit 5a8c3222 authored by Valentin Perrelle's avatar Valentin Perrelle Committed by David Bühler

[dive] use local variables instead of globals in this test

parent f9d917bc
......@@ -2,13 +2,13 @@
STDOPT: +"-dive-from-variables many_values::__retres,many_writes::x"
*/
int t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14;
int *pt[14] = {
&t1, &t2, &t3, &t4, &t5, &t6, &t7, &t8, &t9, &t10, &t11, &t12, &t13, &t14
};
int many_values(int x)
{
int t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0;
int *pt[14] = {
&t1, &t2, &t3, &t4, &t5, &t6, &t7, &t8, &t9, &t10, &t11, &t12, &t13, &t14
};
if (x >= 0 && x < 14)
return *pt[x];
else
......@@ -17,6 +17,8 @@ int many_values(int x)
int many_writes()
{
int t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0;
int x = 0;
x += t1;
x += t2;
......
......@@ -25,12 +25,10 @@ digraph G {
cp25 [label=<*(pt[x])>, shape=parallelogram, fillcolor="#AACCFF",
color="#88AAFF", style="filled,dotted", ];
subgraph cluster_cs_1 { label=<many_writes>; cp2;
subgraph cluster_cs_1 { label=<many_writes>; cp22;cp20;cp18;cp16;cp14;cp12;cp10;cp8;cp6;cp4;cp2;
};
subgraph cluster_cs_2 { label=<many_values>; cp25;cp24;
};
subgraph cluster_file_1 { label=<tests/dive/manydeps.i>; cp22;cp20;cp18;cp16;cp14;cp12;cp10;cp8;cp6;cp4;
};
cp2 -> cp2 [style="bold", ];
cp4 -> cp2;
......
......@@ -6,7 +6,7 @@
[eva:summary] ====== ANALYSIS SUMMARY ======
----------------------------------------------------------------------------
3 functions analyzed (out of 3): 100% coverage.
In these functions, 32 statements reached (out of 32): 100% coverage.
In these functions, 61 statements reached (out of 61): 100% coverage.
----------------------------------------------------------------------------
No errors or warnings raised during the analysis.
----------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment