gdb_test "print m'last(3)" " = 6"
gdb_test "print m'length(3)" " = 3"
+# With GCC the test shows "int" as the element type, but with
+# gnat-llvm it shows "integer"; both of these are reasonable enough so
+# we accept either. The difference here is because GCC emits a
+# declaration in the DWARF for foo.o, but gnat-llvm emits a
+# definition.
gdb_test "ptype global_3dim_for_gdb_testing" \
- "array \\(0 \\.\\. 0, 0 \\.\\. 1, 0 \\.\\. 2\\) of int"
+ [quotemeta "array (0 .. 0, 0 .. 1, 0 .. 2) of @/(int|integer)/"]
gdb_test "print global_3dim_for_gdb_testing'first" " = 0"
gdb_test "print global_3dim_for_gdb_testing'last" " = 0"
type Multi is array (1 .. 1, 2 .. 3, 4 .. 6) of Integer;
M : Multi := (others => (others => (others => 0)));
- -- Use a fake type for importing our C multi-dimensional array.
- -- It's only to make sure the C unit gets linked in, regardless
- -- of possible optimizations.
- type Void_Star is access integer;
- E : Void_Star;
+ type C_Multi is array (0 .. 0, 0 .. 1, 0 .. 2) of Integer;
+ E : C_Multi;
pragma Import (C, E, "global_3dim_for_gdb_testing");
begin
Do_Nothing (M'Address); -- STOP