]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Update annotations in runtime for proof
authorYannick Moy <moy@adacore.com>
Tue, 16 May 2023 13:16:13 +0000 (13:16 +0000)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 20 Jun 2023 07:30:48 +0000 (09:30 +0200)
With bump of stable SPARK used for proof of the runtime,
some annotations need to change.

gcc/ada/

* libgnat/s-aridou.adb (Scaled_Divide): Add assertions.
* libgnat/s-valuti.adb: Add Loop_Variant.
* libgnat/s-valuti.ads: Add Exceptional_Cases on No_Return
procedure.

gcc/ada/libgnat/s-aridou.adb
gcc/ada/libgnat/s-valuti.adb
gcc/ada/libgnat/s-valuti.ads

index 66ace8071ffbc063e5331852681ffabd8564cb03..831590ce3878b9da3e7cf8ad085052e8320adc54 100644 (file)
@@ -2580,8 +2580,19 @@ is
             pragma Assert
               (Big (Double_Uns (Hi (T2))) + Big (Double_Uns (Hi (T1))) =
                    Big (Double_Uns (D (1))));
+            pragma Assert
+              (Is_Mult_Decomposition (D1 => Big (Double_Uns (D (1))),
+                                      D2 => Big (Double_Uns (D (2))),
+                                      D3 => Big (Double_Uns (D (3))),
+                                      D4 => Big (Double_Uns (D (4)))));
          else
             D (1) := 0;
+
+            pragma Assert
+              (Is_Mult_Decomposition (D1 => Big (Double_Uns (D (1))),
+                                      D2 => Big (Double_Uns (D (2))),
+                                      D3 => Big (Double_Uns (D (3))),
+                                      D4 => Big (Double_Uns (D (4)))));
          end if;
 
       else
index ec6fdb03225c763e1a7ba1845f01b8ca24471eb9..ee37c1a636b6799102bfbd96d7377f885e8d6ed7 100644 (file)
@@ -123,6 +123,7 @@ is
       while F < L and then S (F) = ' ' loop
          pragma Loop_Invariant (F in S'First .. L - 1);
          pragma Loop_Invariant (for all J in S'First .. F => S (J) = ' ');
+         pragma Loop_Variant (Increases => F);
          F := F + 1;
       end loop;
 
@@ -139,6 +140,7 @@ is
       while S (L) = ' ' loop
          pragma Loop_Invariant (L in F + 1 .. S'Last);
          pragma Loop_Invariant (for all J in L .. S'Last => S (J) = ' ');
+         pragma Loop_Variant (Decreases => L);
          L := L - 1;
       end loop;
 
index 1faa6471d0df62ef5df49267ef148ea6ae592686..22d0612bc3211864ab2acbb6d08c89c572a93933 100644 (file)
@@ -51,7 +51,8 @@ is
 
    procedure Bad_Value (S : String)
    with
-     Depends => (null => S);
+     Depends => (null => S),
+     Exceptional_Cases => (others => Standard.False);
    pragma No_Return (Bad_Value);
    --  Raises constraint error with message: bad input for 'Value: "xxx"