annotate gcc/testsuite/gcc.dg/tree-ssa/forwprop-29.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-options "-O2 -fno-ipa-icf" } */
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 void runtime_error (void) __attribute__ ((noreturn));
kono
parents:
diff changeset
4 void compiletime_error (void) __attribute__ ((noreturn, error ("")));
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 static void
kono
parents:
diff changeset
7 compiletime_check_equals_1 (int *x, int y)
kono
parents:
diff changeset
8 {
kono
parents:
diff changeset
9 int __p = *x != y;
kono
parents:
diff changeset
10 if (__builtin_constant_p (__p) && __p)
kono
parents:
diff changeset
11 compiletime_error ();
kono
parents:
diff changeset
12 if (__p)
kono
parents:
diff changeset
13 runtime_error ();
kono
parents:
diff changeset
14 }
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 static void
kono
parents:
diff changeset
17 compiletime_check_equals_2 (int *x, int y)
kono
parents:
diff changeset
18 {
kono
parents:
diff changeset
19 int __p = *x != y;
kono
parents:
diff changeset
20 if (__builtin_constant_p (__p) && __p)
kono
parents:
diff changeset
21 compiletime_error (); /* { dg-error "call to" } */
kono
parents:
diff changeset
22 if (__p)
kono
parents:
diff changeset
23 runtime_error ();
kono
parents:
diff changeset
24 }
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 void
kono
parents:
diff changeset
27 foo (int *x)
kono
parents:
diff changeset
28 {
kono
parents:
diff changeset
29 compiletime_check_equals_1 (x, 5);
kono
parents:
diff changeset
30 compiletime_check_equals_2 (x, 10);
kono
parents:
diff changeset
31 }