aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2023-03-14 11:28:24 +0100
committerEric Botcazou <ebotcazou@adacore.com>2023-03-14 11:29:48 +0100
commit67839c562779081936cb79ebca156ef43d70f65f (patch)
treee9adee17af1228a92367598bacb577c888f72fb3 /gcc/testsuite/gnat.dg
parent8b6c38ef6a7a8cc1f7cc2ff86a686e07ceab1641 (diff)
downloadgcc-67839c562779081936cb79ebca156ef43d70f65f.zip
gcc-67839c562779081936cb79ebca156ef43d70f65f.tar.gz
gcc-67839c562779081936cb79ebca156ef43d70f65f.tar.bz2
Add testcase for ifcvt fix
gcc/testsuite/ PR tree-optimization/109005 * gnat.dg/specs/opt6.ads: New test.
Diffstat (limited to 'gcc/testsuite/gnat.dg')
-rw-r--r--gcc/testsuite/gnat.dg/specs/opt6.ads69
1 files changed, 69 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/specs/opt6.ads b/gcc/testsuite/gnat.dg/specs/opt6.ads
new file mode 100644
index 0000000..994949a
--- /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;