aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@gcc.gnu.org>2008-07-30 23:54:56 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2008-07-30 23:54:56 +0000
commit01ddebf20842e3e6b9b9349a2e68cd702bfcc27b (patch)
tree87a4eb9f676e3356453c46961c4ca3f72f9bd2a7 /gcc/testsuite/gnat.dg
parentb8c71e40e0eecc003533b7f294fbe2d29e641326 (diff)
downloadgcc-01ddebf20842e3e6b9b9349a2e68cd702bfcc27b.zip
gcc-01ddebf20842e3e6b9b9349a2e68cd702bfcc27b.tar.gz
gcc-01ddebf20842e3e6b9b9349a2e68cd702bfcc27b.tar.bz2
re PR ada/36554 (verify_flow_info ICE can not throw but has EH edges)
PR ada/36554 * dwarf2out.c (is_subrange_type): Deal with BOOLEAN_TYPE. ada/ * back_end.adb (Call_Back_End): Pass Standard_Boolean to gigi. * gcc-interface/gigi.h (gigi): Take new standard_boolean parameter. * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Enumeration_Subtype>: Set precision to 1 for subtype of BOOLEAN_TYPE. (set_rm_size): Set TYPE_RM_SIZE_NUM for BOOLEAN_TYPE. (make_type_from_size): Deal with BOOLEAN_TYPE. * gcc-interface/misc.c (gnat_print_type): Likewise. * gcc-interface/trans.c (gigi): Take new standard_boolean parameter. Set boolean_type_node as its translation in the table, as well as boolean_false_node for False and boolean_true_node for True. * gcc-interface/utils.c (gnat_init_decl_processing): Create custom 8-bit boolean_type_node and set its TYPE_RM_SIZE_NUM. (create_param_decl): Deal with BOOLEAN_TYPE. (build_vms_descriptor): Likewise. (build_vms_descriptor64): Likewise. (convert): Deal with BOOLEAN_TYPE like with ENUMERAL_TYPE. From-SVN: r138348
Diffstat (limited to 'gcc/testsuite/gnat.dg')
-rw-r--r--gcc/testsuite/gnat.dg/boolean_expr.adb30
-rw-r--r--gcc/testsuite/gnat.dg/boolean_expr.ads5
2 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/boolean_expr.adb b/gcc/testsuite/gnat.dg/boolean_expr.adb
new file mode 100644
index 0000000..6ac086d
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/boolean_expr.adb
@@ -0,0 +1,30 @@
+-- PR middle-end/36554
+-- Origin: Laurent Guerby <laurent@guerby.net>
+
+-- { dg-do compile }
+-- { dg-options "-O2" }
+
+package body Boolean_Expr is
+
+ function Long_Float_Is_Valid (X : in Long_Float) return Boolean is
+ Is_Nan : constant Boolean := X /= X;
+ Is_P_Inf : constant Boolean := X > Long_Float'Last;
+ Is_M_Inf : constant Boolean := X < Long_Float'First;
+ Is_Invalid : constant Boolean := Is_Nan or Is_P_Inf or Is_M_Inf;
+ begin
+ return not Is_Invalid;
+ end Long_Float_Is_Valid;
+
+ function S (V : in Long_Float) return String is
+ begin
+ if not Long_Float_Is_Valid (V) then
+ return "INVALID";
+ else
+ return "OK";
+ end if;
+ exception
+ when others =>
+ return "ERROR";
+ end S;
+
+end Boolean_Expr;
diff --git a/gcc/testsuite/gnat.dg/boolean_expr.ads b/gcc/testsuite/gnat.dg/boolean_expr.ads
new file mode 100644
index 0000000..8190ce7
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/boolean_expr.ads
@@ -0,0 +1,5 @@
+package Boolean_Expr is
+
+ function S (V : in Long_Float) return String;
+
+end Boolean_Expr;