public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-6660] Add testcase for ifcvt fix
@ 2023-03-14 10:43 Eric Botcazou
  0 siblings, 0 replies; only message in thread
From: Eric Botcazou @ 2023-03-14 10:43 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:67839c562779081936cb79ebca156ef43d70f65f

commit r13-6660-g67839c562779081936cb79ebca156ef43d70f65f
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Tue Mar 14 11:28:24 2023 +0100

    Add testcase for ifcvt fix
    
    gcc/testsuite/
            PR tree-optimization/109005
            * gnat.dg/specs/opt6.ads: New test.

Diff:
---
 gcc/testsuite/gnat.dg/specs/opt6.ads | 69 ++++++++++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)

diff --git a/gcc/testsuite/gnat.dg/specs/opt6.ads b/gcc/testsuite/gnat.dg/specs/opt6.ads
new file mode 100644
index 00000000000..994949a6571
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/specs/opt6.ads
@@ -0,0 +1,69 @@
+-- { dg-do compile }
+-- { dg-options "-O2" }
+
+package Opt6 is
+
+   type Timer_Output_Compare_And_PWM_Mode is
+     (Frozen,
+      Active,
+      Inactive,
+      Toggle,
+      Force_Inactive,
+      Force_Active,
+      PWM1,
+      PWM2);
+
+   type Timer_Capture_Compare_Modes is
+     (Output, Direct_TI, Indirect_TI, TRC);
+
+   type Timer_Input_Capture_Filter is mod 16;
+
+   type Timer_Input_Capture_Prescaler is
+     (Div1,
+      Div2,
+      Div4,
+      Div8);
+
+   type Channel_Output_Descriptor is record
+      OCxFast_Enable    : Boolean;
+      OCxPreload_Enable : Boolean;
+      OCxMode           : Timer_Output_Compare_And_PWM_Mode;
+      OCxClear_Enable   : Boolean;
+   end record with Size => 6;
+   for Channel_Output_Descriptor use record
+      OCxFast_Enable    at 0 range 0 .. 0;
+      OCxPreload_Enable at 0 range 1 .. 1;
+      OCxMode           at 0 range 2 .. 4;
+      OCxClear_Enable   at 0 range 5 .. 5;
+   end record;
+
+   type Channel_Input_Descriptor is record
+      ICxFilter    : Timer_Input_Capture_Filter;
+      ICxPrescaler : Timer_Input_Capture_Prescaler;
+   end record with Size => 6;
+   for Channel_Input_Descriptor use record
+      ICxFilter    at 0 range 2 .. 5;
+      ICxPrescaler at 0 range 0 .. 1;
+   end record;
+
+   type IO_Descriptor (CCxSelection : Timer_Capture_Compare_Modes := Output) is
+      record
+         case CCxSelection is
+            when Direct_TI .. TRC =>
+               Capture : Channel_Input_Descriptor;
+            when Output =>
+               Compare : Channel_Output_Descriptor;
+         end case;
+      end record with Size => 8;
+   for IO_Descriptor use record
+      CCxSelection at 0 range 0 .. 1;
+      Capture      at 0 range 2 .. 7;
+      Compare      at 0 range 2 .. 7;
+   end record;
+
+   subtype Lower_Half_Index is Integer range 1 .. 2;
+   type TIMx_CCMRx_Lower_Half is
+     array (Lower_Half_Index) of IO_Descriptor
+   with Volatile_Components, Component_Size => 8, Size => 16;
+
+end Opt6;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-14 10:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-14 10:43 [gcc r13-6660] Add testcase for ifcvt fix Eric Botcazou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).