Debian Codegraph @

gcc/testsuite/gfortran.dg/unsigned_11.f90

raw
1 ! { dg-do run }
2 ! { dg-options "-funsigned" }
3 ! Test min/max
4 program main
5 unsigned :: u_a, u_b
6 if (max(1u,2u) /= 2u) error stop 1
7 if (max(2u,1u) /= 2u) error stop 2
8 if (min(1u,2u) /= 1u) error stop 3
9 if (min(2u,1u) /= 1u) error stop 4
10 u_a = 1u
11 u_b = 2u
12 if (max(u_a,u_b) /= u_b) error stop 5
13 if (max(u_b,u_a) /= u_b) error stop 6
14 if (min(u_a,u_b) /= u_a) error stop 7
15 if (min(u_b,u_a) /= u_a) error stop 8
16 if (max(4294967295u, 1u) /= 4294967295u) error stop 9
17 u_a = 4294967295u
18 u_b = 1u
19 if (max(u_a,u_b) /= 4294967295u) error stop 10
20 if (max(u_b,u_a) /= 4294967295u) error stop 11
21 if (min(u_a,u_b) /= 1u) error stop 12
22 if (min(u_b,u_a) /= 1u) error stop 13
23 end program