[pushed] Fix one test case for gnat-llvm
Commit Message
LLVM is a bit eager about removing unused locals. Investigating this
test case showed that the problem was that some array bounds, which
are stored in artificial locals, are not emitted.
Since this isn't really germane to the test, and because real code
doesn't normally do this kind of thing, I think it's best to simply
update the test to preserve the bounds.
As this patch is Ada-specific, I am checking it in.
---
gdb/testsuite/gdb.ada/enum_idx_packed/foo.adb | 27 +++++++++++++++++++
1 file changed, 27 insertions(+)
base-commit: bc145a24033381e93bae0ee24add664386c66433
@@ -30,12 +30,39 @@ procedure Foo is
Green => (5, 6, 7),
others => (others => 72));
+ -- These variables ensure the bounds aren't elided by LLVM.
+ Small_First : Color := Small'First;
+ Small_Last : Color := Small'Last;
+ Multi_First1 : Color := Multi'First (1);
+ Multi_Last1 : Color := Multi'Last (1);
+ Multi_First2 : Strength := Multi'First (2);
+ Multi_Last2 : Strength := Multi'Last (2);
+
+ MM_First1 : Positive := Multi_Multi'First (1);
+ MM_Last1 : Positive := Multi_Multi'Last (1);
+ MM_First2 : Positive := Multi_Multi'First (2);
+ MM_Last2 : Positive := Multi_Multi'Last (2);
+ MM_First3 : Positive := Multi_Multi'First (3);
+ MM_Last3 : Positive := Multi_Multi'Last (3);
+
begin
Do_Nothing (Full'Address); -- STOP
Do_Nothing (Primary'Address);
Do_Nothing (Cold'Address);
Do_Nothing (Small'Address);
+ Do_Nothing (Small_First'Address);
+ Do_Nothing (Small_Last'Address);
Do_Nothing (Multi'Address);
+ Do_Nothing (Multi_First1'Address);
+ Do_Nothing (Multi_Last1'Address);
+ Do_Nothing (Multi_First2'Address);
+ Do_Nothing (Multi_Last2'Address);
Do_Nothing (Multi_Multi'Address);
Do_Nothing (Multi_Access'Address);
+ Do_Nothing (MM_First1'Address);
+ Do_Nothing (MM_Last1'Address);
+ Do_Nothing (MM_First2'Address);
+ Do_Nothing (MM_Last2'Address);
+ Do_Nothing (MM_First3'Address);
+ Do_Nothing (MM_Last3'Address);
end Foo;