Skip to content
Snippets Groups Projects
Commit 0171793a authored by Eric Botcazou's avatar Eric Botcazou
Browse files

Silence warning for 32-bit targets

gcc/testsuite
	PR ada/115250
	* gnat.dg/opt58_pkg.ads: Convert to Unix line ending.
	* gnat.dg/opt58.adb: Likewise and pass -gnatws to the compiler.
parent 4645aa79
No related branches found
No related tags found
No related merge requests found
-- { dg-do compile }
-- { dg-options "-O" }
with Unchecked_Conversion;
with System; use System;
with Opt58_Pkg; use Opt58_Pkg;
procedure Opt58 is
function Convert is new Unchecked_Conversion (Integer, Rec);
Dword : Integer := 0;
I : Small_Int := F1 (Convert (Dword));
begin
if F2 (Null_Address, I = 0) then
null;
end if;
end Opt58;
-- { dg-do compile }
-- { dg-options "-O -gnatws" }
with Unchecked_Conversion;
with System; use System;
with Opt58_Pkg; use Opt58_Pkg;
procedure Opt58 is
function Convert is new Unchecked_Conversion (Integer, Rec);
Dword : Integer := 0;
I : Small_Int := F1 (Convert (Dword));
begin
if F2 (Null_Address, I = 0) then
null;
end if;
end Opt58;
with System; use System;
package Opt58_Pkg is
pragma Pure (Opt58_Pkg);
type Small_Int is range 0 .. 255;
type Rec is record
D1, D2, D3, D4 : Small_Int;
end record;
pragma Pack (Rec);
for Rec'Size use 32;
function F1 (R : Rec) return Small_Int;
function F2 (A : Address; B : Boolean) return Boolean;
end Opt58_Pkg;
with System; use System;
package Opt58_Pkg is
pragma Pure (Opt58_Pkg);
type Small_Int is range 0 .. 255;
type Rec is record
D1, D2, D3, D4 : Small_Int;
end record;
pragma Pack (Rec);
for Rec'Size use 32;
function F1 (R : Rec) return Small_Int;
function F2 (A : Address; B : Boolean) return Boolean;
end Opt58_Pkg;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment