diff options
Diffstat (limited to 'gcc/testsuite/gnat.dg')
-rw-r--r-- | gcc/testsuite/gnat.dg/lto16.adb | 17 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/lto16_pkg.adb | 18 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/lto16_pkg.ads | 5 |
3 files changed, 40 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/lto16.adb b/gcc/testsuite/gnat.dg/lto16.adb new file mode 100644 index 0000000..82d02b4 --- /dev/null +++ b/gcc/testsuite/gnat.dg/lto16.adb @@ -0,0 +1,17 @@ +-- { dg-do link } +-- { dg-options "-O -flto" } +-- { dg-require-effective-target lto } + +with Lto16_Pkg; use Lto16_Pkg; +with Text_IO; use Text_IO; + +procedure Lto16 is +begin + if F = 0.0 then + Put_Line ("zero"); + else + Put_Line ("non-zero"); + end if; +exception + when others => Put_Line ("exception"); +end; diff --git a/gcc/testsuite/gnat.dg/lto16_pkg.adb b/gcc/testsuite/gnat.dg/lto16_pkg.adb new file mode 100644 index 0000000..edfa399 --- /dev/null +++ b/gcc/testsuite/gnat.dg/lto16_pkg.adb @@ -0,0 +1,18 @@ +with Ada.Calendar; use Ada.Calendar; + +package body Lto16_Pkg is + + function F return Float is + F1 : Float := Float (Seconds (Clock)); + F2 : Float := Float (Seconds (Clock)); + F : Float; + begin + if F1 > F2 then + F := (F2 - F1) / 2.0; + else + F := (F1 - F2) / 2.0; + end if; + return F; + end; + +end Lto16_Pkg; diff --git a/gcc/testsuite/gnat.dg/lto16_pkg.ads b/gcc/testsuite/gnat.dg/lto16_pkg.ads new file mode 100644 index 0000000..e9b74d3 --- /dev/null +++ b/gcc/testsuite/gnat.dg/lto16_pkg.ads @@ -0,0 +1,5 @@ +package Lto16_Pkg is + + function F return Float; + +end Lto16_Pkg; |