c371003.a

来自「用于进行gcc测试」· A 代码 · 共 475 行 · 第 1/2 页

A
475
字号
               Report.Comment ("VObj_5 - wrong values");            end if;         end;      exception         when others =>              Report.Failed ("Arr - unexpected exception raised");      end;      ---------------------------------------------------------      -- Component containing the constraint is present.      begin         declare            type Rec_Of_Rec_Of_MyArr is              record                 C1 : VRec_Of_MyArr_01(1);    -- No Constraint_Error raised.              end record;                             begin            declare               Obj_6 : Rec_Of_Rec_Of_MyArr;   -- Constraint_Error raised.            begin               Report.Failed ("Obj_6 - Constraint_Error should be raised");               if Obj_6 /= (C1 => (1, (1, 1))) then                  Report.Comment ("Obj_6 - Shouldn't get here");               end if;            end;         exception            when Constraint_Error =>         -- Exception expected.                null;            when others =>                Report.Failed ("Obj_6 - unexpected exception raised");         end;      exception         when Constraint_Error =>              Report.Failed ("Rec_Of_Rec_Of_MyArr - Constraint_Error raised");         when others =>              Report.Failed ("Rec_Of_Rec_Of_MyArr - unexpected exception " &                             "raised");      end;      ---------------------------------------------------------      -- Component containing the constraint is absent.      begin         declare            type New_VRec_Arr is               new VRec_Of_MyArr_01(11);       -- No Constraint_Error raised            Obj_7 : New_VRec_Arr;             -- for either declaration.         begin            if Obj_7 /= (11, 0) then               Report.Failed ("Obj_7 - value incorrect");            end if;         end;      exception         when others =>              Report.Failed ("New_VRec_Arr - unexpected exception raised");      end;      ---------------------------------------------------------      -- Component containing the constraint is present.      begin         declare            type New_VRec is new              VRec_Of_VRec_02(Report.Ident_Int(0)); -- No Constraint_Error                                                     -- raised.         begin            declare                VObj_8 : New_VRec;                  -- Constraint_Error raised.            begin               Report.Failed ("VObj_8 - Constraint_Error should be raised");               if VObj_8 /= (1, (1, 1, others => (others => '*'))) then                  Report.Comment ("VObj_8 - Shouldn't get here");               end if;            end;         exception            when Constraint_Error =>               -- Exception expected.                null;            when others =>                Report.Failed ("VObj_8 - unexpected exception raised");         end;      exception                                             when Constraint_Error =>              Report.Failed ("New_VRec - Constraint_Error raised");         when others =>              Report.Failed ("New_VRec - unexpected exception raised");      end;      ---------------------------------------------------------      -- Component containing the constraint is absent.      begin         declare            subtype Sub_VRec is              VRec_Of_VRec_02(Report.Ident_Int(11)); -- No Constraint_Error             VObj_9 : Sub_VRec;                       -- raised for either                                                     -- declaration.         begin            if VObj_9 /= (11, 0) then               Report.Comment ("VObj_9 - wrong values");            end if;         end;      exception                                             when others =>              Report.Failed ("Sub_VRec - unexpected exception raised");      end;      ---------------------------------------------------------      -- Component containing the constraint is present.      begin         declare            type Acc_VRec_01 is access               VRec_Of_VRec_02(Report.Ident_Int(0));  -- No Constraint_Error                                                      -- raised.         begin            declare               VObj_10 : Acc_VRec_01;                -- No Constraint_Error                                                      -- raised.            begin               VObj_10 := new VRec_Of_VRec_02                            (Report.Ident_Int(0));   -- Constraint_Error                                                     -- raised.               Report.Failed ("VObj_10 - Constraint_Error should be raised");               if VObj_10.all /= (1, (1, 1, others => (others => '*'))) then                  Report.Comment ("VObj_10 - Shouldn't get here");               end if;                 exception               when Constraint_Error =>              -- Exception expected.                   null;               when others =>                   Report.Failed ("VObj_10 - unexpected exception raised");            end;         exception            when Constraint_Error =>                Report.Failed ("VObj_10 - Constraint_Error exception raised");            when others =>                Report.Failed ("VObj_10 - unexpected exception raised at " &                               "declaration");         end;      exception         when Constraint_Error =>              Report.Failed ("Acc_VRec_01 - Constraint_Error raised");         when others =>              Report.Failed ("Acc_VRec_01 - unexpected exception raised");      end;      ---------------------------------------------------------      -- Component containing the constraint is absent.      begin         declare            type Acc_VRec_02 is access               VRec_Of_VRec_02(11);                  -- No Constraint_Error                                                     -- raised for either            VObj_11 :  Acc_VRec_02;                 -- declaration.         begin            VObj_11 := new VRec_Of_VRec_02(11);            if VObj_11.all /= (11, 0) then               Report.Comment ("VObj_11 - wrong values");            end if;         end;      exception         when others =>              Report.Failed ("Acc_VRec_02 - unexpected exception raised");      end;      ---------------------------------------------------------      -- Component containing the constraint is present.      begin         declare            type Acc_VRec_03 is access               VRec_Of_MyArr_02;                    -- No Constraint_Error                                                    -- raised for either            VObj_12 : Acc_VRec_03;                 -- declaration.         begin            VObj_12 := new VRec_Of_MyArr_02                           (Report.Ident_Int(0)); -- Constraint_Error raised.            Report.Failed ("VObj_12 - Constraint_Error should be raised");            if VObj_12.all /= (1, (1, 1)) then               Report.Comment ("VObj_12 - Shouldn't get here");            end if;                exception            when Constraint_Error =>              -- Exception expected.                null;            when others =>                Report.Failed ("VObj_12 - unexpected exception raised");         end;      exception         when Constraint_Error =>              Report.Failed ("Acc_VRec_03 - Constraint_Error raised");         when others =>              Report.Failed ("Acc_VRec_03 - unexpected exception raised");      end;      ---------------------------------------------------------      -- Component containing the constraint is absent.      begin         declare            type Acc_VRec_04 is access               VRec_Of_MyArr_02(11);                 -- No Constraint_Error                                                     -- raised for either            VObj_13 :  Acc_VRec_04;                 -- declaration.                             begin            VObj_13 := new VRec_Of_MyArr_02(11);            if VObj_13.all /= (11, 0) then               Report.Comment ("VObj_13 - wrong values");            end if;         end;      exception         when others =>              Report.Failed ("Acc_VRec_04 - unexpected exception raised");      end;   end;   Report.Result;exception     when others =>          Report.Failed ("Discriminant value checked too soon");          Report.Result;end C371003;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?