Testcase adjustments for pass vrp1.

Unify testcases for the vrp1 pass so they will work with the output from either
VRP or ranger.

	gcc/testsuite/
	* gcc.dg/tree-ssa/pr23744.c: Tweak output checks.
	* gcc.dg/tree-ssa/vrp07.c: Ditto.
	* gcc.dg/tree-ssa/vrp08.c: Ditto.
	* gcc.dg/tree-ssa/vrp09.c: Ditto.
	* gcc.dg/tree-ssa/vrp20.c: Ditto.
	* gcc.dg/tree-ssa/vrp92.c: Ditto.
	* jit.dg/test-sum-of-squares.c: Ditto.
This commit is contained in:
Andrew MacLeod 2021-11-01 16:20:23 -04:00
parent 6d936684fc
commit 1410b20801
7 changed files with 16 additions and 17 deletions

View file

@ -1,5 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fno-tree-ccp -fdisable-tree-evrp -fdump-tree-vrp1-details" } */
/* { dg-options "-O2 -fno-tree-ccp -fdisable-tree-evrp -fdump-tree-vrp1" } */
void h (void);
@ -17,4 +17,5 @@ int g (int i, int j)
return 1;
}
/* { dg-final { scan-tree-dump-times "gimple_simplified" 1 "vrp1" } } */
/* { dg-final { scan-tree-dump-times "return 0" 1 "vrp1" } } */
/* { dg-final { scan-tree-dump-not "return 1" "vrp1" } } */

View file

@ -34,6 +34,3 @@ foo (int i, int *p)
/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 1 "vrp1" } } */
/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 0" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 0" 0 "vrp1" { target { keeps_null_pointer_checks } } } } */
/* { dg-final { scan-tree-dump-times "PREDICATE: p_\[0-9\]" 2 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
/* { dg-final { scan-tree-dump-times "PREDICATE: p_\[0-9\]" 1 "vrp1" { target { keeps_null_pointer_checks } } } } */

View file

@ -20,5 +20,4 @@ foo (int a, int *p)
}
/* Target disabling -fdelete-null-pointer-checks should not fold checks */
/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
/* { dg-final { scan-tree-dump-times "PREDICATE: p_.* ne_expr 0" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 0 "vrp1" { target { keeps_null_pointer_checks } } } } */

View file

@ -27,4 +27,5 @@ L78:
}
}
/* { dg-final { scan-tree-dump-times "Folding predicate p_.. != 0B to 1" 2 "vrp1" } } */
/* { dg-final { scan-tree-dump-times "Folding predicate p_" 2 "vrp1" } } */
/* { dg-final { scan-tree-dump-times "!= 0B to 1" 2 "vrp1" } } */

View file

@ -23,5 +23,5 @@ int g (int b) {
return 1;
}
/* { dg-final { scan-tree-dump "Folding predicate a_. == 0 to 0" "vrp1" } } */
/* { dg-final { scan-tree-dump "Folding predicate b_. != 0 to 1" "vrp1" } } */
/* { dg-final { scan-tree-dump "Folding predicate a_\.\* == 0 to 0" "vrp1" } } */
/* { dg-final { scan-tree-dump "Folding predicate b_\.\* != 0 to 1" "vrp1" } } */

View file

@ -1,5 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fdisable-tree-evrp -fno-tree-fre -fdump-tree-vrp1-details -fdisable-tree-ethread" } */
/* { dg-options "-O2 -fdisable-tree-evrp -fno-tree-fre -fdump-tree-vrp1 -fdisable-tree-ethread" } */
void bar (void);
int foo (int i, int j)
@ -18,5 +18,6 @@ int foo (int i, int j)
return j;
}
/* { dg-final { scan-tree-dump "res_.: int \\\[1, 1\\\]" "vrp1" } } */
/* { dg-final { scan-tree-dump-not "Threaded" "vrp1" } } */
/* { dg-final { scan-tree-dump-not "PHI" "vrp1" } } */
/* { dg-final { scan-tree-dump-not "goto" "vrp1" } } */
/* { dg-final { scan-tree-dump-not "if" "vrp1" } } */

View file

@ -133,10 +133,10 @@ verify_code (gcc_jit_context *ctxt, gcc_jit_result *result)
An example of using gcc_jit_context_enable_dump to verify a property
of the compile.
In this case, verify that vrp is able to deduce the
bounds of the iteration variable. Specifically, verify that some
variable is known to be in the range negative infinity to some
expression based on param "n" (actually n-1). */
CHECK_STRING_CONTAINS (dump_vrp1, "[-INF, n_");
In particular, this example verifies that we can read the dump from a
pass with multiple instances. Given that the format of the VRP dump
is subject to change, merely verify that it contains the function
name. */
CHECK_STRING_CONTAINS (dump_vrp1, ";; Function loop_test");
free (dump_vrp1);
}