]> gcc.gnu.org Git - gcc.git/commitdiff
Add testcase for ifcvt fix
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 14 Mar 2023 10:28:24 +0000 (11:28 +0100)
committerEric Botcazou <ebotcazou@adacore.com>
Tue, 14 Mar 2023 10:29:48 +0000 (11:29 +0100)
gcc/testsuite/
PR tree-optimization/109005
* gnat.dg/specs/opt6.ads: New test.

gcc/testsuite/gnat.dg/specs/opt6.ads [new file with mode: 0644]

diff --git a/gcc/testsuite/gnat.dg/specs/opt6.ads b/gcc/testsuite/gnat.dg/specs/opt6.ads
new file mode 100644 (file)
index 0000000..994949a
--- /dev/null
@@ -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;
This page took 0.065545 seconds and 5 git commands to generate.