* lib/target-supports.exp(check_effective_target_keeps_null_pointer_checks): New function.
* gcc.dg/tree-ssa/
20030730-1.c: Use keeps_null_pointer_checks to determine correct test response.
* gcc.dg/tree-ssa/
20030730-2.c: Ditto.
* gcc.dg/tree-ssa/pr20701.c: Ditto.
* gcc.dg/tree-ssa/pr20702.c: Ditto.
* gcc.dg/tree-ssa/pr21086.c: Ditto.
* gcc.dg/tree-ssa/vrp02.c:: Ditto.
* gcc.dg/tree-ssa/vrp07.c:: Ditto.
* gcc.dg/tree-ssa/vrp08.c:: Ditto.
From-SVN: r136970
+2008-06-19 Andy Hutchinson <hutchinsonandy@aim.com>
+
+ * lib/target-supports.exp
+ (check_effective_target_keeps_null_pointer_checks) : New function.
+ * gcc.dg/tree-ssa/20030730-1.c: Use keeps_null_pointer_checks to
+ determine correct test response.
+ * gcc.dg/tree-ssa/20030730-2.c: Ditto.
+ * gcc.dg/tree-ssa/pr20701.c: Ditto.
+ * gcc.dg/tree-ssa/pr20702.c: Ditto.
+ * gcc.dg/tree-ssa/pr21086.c: Ditto.
+ * gcc.dg/tree-ssa/vrp02.c:: Ditto.
+ * gcc.dg/tree-ssa/vrp07.c:: Ditto.
+ * gcc.dg/tree-ssa/vrp08.c:: Ditto.
+
2008-06-19 Andy Hutchinson <hutchinsonandy@aim.com>
* gcc.dg/pragma-pack-4.c: Skip for AVR target.
exit (0);
}
-/* There should be no IF conditionals. */
-/* { dg-final { scan-tree-dump-times "if " 0 "dom3" } } */
-
+/* There should be no IF conditionals, unless target has fno-delete-null-pointer-checks */
+/* { dg-final { scan-tree-dump-times "if " 0 "dom3" { target { ! keeps_null_pointer_checks } } } } */
+/* { dg-final { scan-tree-dump "if " "dom3" { target { keeps_null_pointer_checks } } } } */
+
/* { dg-final { cleanup-tree-dump "dom3" } } */
exit (0);
}
-/* There should be no IF conditionals. */
-/* { dg-final { scan-tree-dump-times "if " 0 "dom3" } } */
+/* There should be no IF conditionals, unless target has fno-delete-null-pointer-checks */
+/* { dg-final { scan-tree-dump-times "if " 0 "dom3" { target { ! keeps_null_pointer_checks } } } } */
+/* { dg-final { scan-tree-dump "if " "dom3" { target { keeps_null_pointer_checks } } } } */
/* { dg-final { cleanup-tree-dump "dom3" } } */
return 0;
}
-/* { dg-final { scan-tree-dump-times "Folding predicate.*to 0" 1 "vrp2" } } */
+/* Target with fno-delete-null-pointer-checks should not fold checks */
+/* { dg-final { scan-tree-dump-times "Folding predicate.*to 0" 1 "vrp2" { target { ! keeps_null_pointer_checks } } } } */
+/* { dg-final { scan-tree-dump-times "Folding predicate.*to 0" 0 "vrp2" { target { keeps_null_pointer_checks } } } } */
/* { dg-final { cleanup-tree-dump "vrp2" } } */
return a;
}
-/* { dg-final { scan-tree-dump-times "Folding predicate" 1 "vrp1"} } */
+/* Target with fno-delete-null-pointer-checks should not fold checks */
+/* { dg-final { scan-tree-dump-times "Folding predicate" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
+/* { dg-final { scan-tree-dump-times "Folding predicate" 0 "vrp1" { target { keeps_null_pointer_checks } } } } */
/* { dg-final { cleanup-tree-dump "vrp1" } } */
return 0;
}
-/* { dg-final { scan-tree-dump-times "Folding predicate " 1 "vrp1" } } */
-/* { dg-final { scan-tree-dump-not "b_. =" "vrp1" } } */
+/* Target with fno-delete-null-pointer-checks should not fold checks */
+/* { dg-final { scan-tree-dump-times "Folding predicate " 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
+/* { dg-final { scan-tree-dump-times "Folding predicate " 0 "vrp1" { target { keeps_null_pointer_checks } } } } */
+/* { dg-final { scan-tree-dump-not "b_. =" "vrp1" { target { ! avr-*-* } } } } */
+/* { dg-final { scan-tree-dump "b_. =" "vrp1" { target { avr-*-* } } } } */
/* { dg-final { cleanup-tree-dump "vrp1" } } */
if (p)
return x + p->b;
}
-
-/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 1 "vrp1" } } */
+/* Target with fno-delete-null-pointer-checks should not fold check */
+/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 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 } } } } */
/* { dg-final { cleanup-tree-dump "vrp1" } } */
return i;
}
-
+/* Target with fno-delete-null-pointer-checks should not fold checks */
/* { 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" } } */
-/* { dg-final { scan-tree-dump-times "PREDICATE: p_\[0-9\]" 2 "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 } } } } */
/* { dg-final { cleanup-tree-dump "vrp1" } } */
return a;
}
-
-/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 1 "vrp1" } } */
-/* { dg-final { scan-tree-dump-times "PREDICATE: p_.* ne_expr 0" 1 "vrp1" } } */
+/* Target with fno-delete-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 } } } } */
/* { dg-final { cleanup-tree-dump "vrp1" } } */
return 1
}
+# Return 1 if according to target_info struct and explicit target list
+# target is supposed to keep null pointer checks. This could be due to
+# use of option fno-delete-null-pointer-checks or hardwired in target.
+
+proc check_effective_target_keeps_null_pointer_checks { } {
+ if [target_info exists keeps_null_pointer_checks] {
+ return 1
+ }
+ if { [istarget avr-*-*] } {
+ return 1;
+ }
+ return 0
+}
+
# Return true if profiling is supported on the target.
proc check_profiling_available { test_what } {