forked from Imagelibrary/binutils-gdb
Make this testcase a bit more realistic. The current code
is too simplistic, and allows the compiler to optimize out
some of the entities we need for this testcase.
* gdb.ada/null_record/bar.ads (Void_Star): New type.
(Do_Nothing): Add extra parameter.
* gdb.ada/null_record/bar.adb (Do_Nothing): Likewise.
* gdb.ada/null_record/null_record.adb: Fake use of type Empty
by using a variable of type Void_Star.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
-- Copyright 2004 Free Software Foundation, Inc.
|
||||
-- Copyright 2004, 2007 Free Software Foundation, Inc.
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package body Bar is
|
||||
|
||||
procedure Do_Nothing is
|
||||
procedure Do_Nothing (E : Void_Star) is
|
||||
begin
|
||||
null;
|
||||
end Do_Nothing;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- Copyright 2004 Free Software Foundation, Inc.
|
||||
-- Copyright 2004, 2007 Free Software Foundation, Inc.
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
@@ -17,7 +17,8 @@
|
||||
package Bar is
|
||||
|
||||
type Empty is null record;
|
||||
type Void_Star is access all Empty;
|
||||
|
||||
procedure Do_Nothing;
|
||||
procedure Do_Nothing (E : Void_Star);
|
||||
|
||||
end Bar;
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
with Bar; use Bar;
|
||||
|
||||
procedure Null_Record is
|
||||
E : Void_Star := new Empty;
|
||||
begin
|
||||
Do_Nothing;
|
||||
Do_Nothing (E);
|
||||
end Null_Record;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user