gcc/testsuite/gnat.dg/modular6.adb
raw| 1 | -- { dg-do compile } |
| 2 | |
| 3 | with Ada.Text_IO; use Ada.Text_IO; |
| 4 | |
| 5 | procedure Modular6 is |
| 6 | Max : Integer := 0; |
| 7 | |
| 8 | type Modulus is mod 3; |
| 9 | begin |
| 10 | Max := 30; |
| 11 | |
| 12 | for N in 1 .. Max loop |
| 13 | Put_Line("N: " & Integer'Image(N) & " Modulus: " & Integer'Image(Modulus'Modulus) & " Mod:" & Modulus'Image(Modulus'Mod(N))); |
| 14 | end loop; |
| 15 | end; |