re PR debug/49522 (Divide by zero in validate_subreg in emit-rtl.c:695)
[gcc.git] / gcc / testsuite / gcc.dg / debug / pr49522.c
1 /* PR debug/49522 */
2 /* { dg-do compile } */
3 /* { dg-options "-fcompare-debug" } */
4
5 int val1 = 0L;
6 volatile int val2 = 7L;
7 long long val3;
8 int *ptr = &val1;
9
10 static int
11 func1 ()
12 {
13 return 0;
14 }
15
16 static short int
17 func2 (short int a, unsigned int b)
18 {
19 return !b ? a : a >> b;
20 }
21
22 static unsigned long long
23 func3 (unsigned long long a, unsigned long long b)
24 {
25 return !b ? a : a % b;
26 }
27
28 void
29 func4 (unsigned short arg1, int arg2)
30 {
31 for (arg2 = 0; arg2 < 2; arg2++)
32 {
33 *ptr = func3 (func3 (10, func2 (val3, val2)), val3);
34 for (arg1 = -14; arg1 > 14; arg1 = func1 ())
35 {
36 *ptr = -1;
37 if (foo ())
38 ;
39 }
40 }
41 }