From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by sourceware.org (Postfix) with ESMTPS id 69B9E3858D20 for ; Fri, 11 Aug 2023 16:07:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 69B9E3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-io1-xd2f.google.com with SMTP id ca18e2360f4ac-79196067c75so40355239f.1 for ; Fri, 11 Aug 2023 09:07:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1691770033; x=1692374833; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Sri/e5Cm/4mnf1v6Y9LxMvjCcuaKkN6Kq0XduvxQ92Q=; b=TF+jsA+GipSBky/y7rAGTGbynWtxctAk+QbdUDsmzOXFUHWTvmaz0dUqB6ZnHw7bsq jU4aPhiO0mIiMlk0E3R8KD2gR7WL3IhE6ZsqdPmSJQ1v8KCNGYpUoOGJ6eImPi1mvETw 0eMNqSoy566ovCVu2jviz8V/uxsMQ6CG88B97pvY1Hz+ot1L8JZskwwyDZGXwTQMs8vN CvmU4LJHYFz7S9ZBsDnqqgSYpM5yh56YQ8LKK1b+sajFyqK0BML8QgsfxZLHtAtB8crR /MCnT3Aok+3ZRb9SZBsTa8Ugww281XcJ//trwDNd3wi7AgtS2yLU/8RFtHNPwlrQXjYq C1Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691770033; x=1692374833; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Sri/e5Cm/4mnf1v6Y9LxMvjCcuaKkN6Kq0XduvxQ92Q=; b=l7tjYi8ognpOQIZ9PDZnhdLD9edFK3KnO4PDxbOWp1m+jJxDhnQ99J7v648bJlnjTY UNeT8JQcyVm2xWsXY+TyCKtoaDrdLEGev1l6k4Sf1twyMccyMwYYn5f2YxZu7jDhyGGV IWxg9OnwyLjjC+Z9cEi5GMzC9HGjrCC+tGH8j2fBGwJkzLrUcYxkdoknW1jG0cXaRSLj T5Cyb8XMCi/7Rk55dTB05HRL0tck1X2evLG68PvME0YZTuxLWh03oIYAwVKpQBHohmCG AAxi2qanRZgv/h6H3sqAl5v78a0aP3/WvAKTsxc9U/mXdRScmUeaan0C+x/ovgeGVmSG vqKQ== X-Gm-Message-State: AOJu0YwI1id/j/w8/xrW4NKS82ntLmwn1+MK8S/CM0rA7yZSPyAh4t1a e+pWpWw7rrQH4T5x1fxvlijdA9e9sbcBFEAEysdvhw== X-Google-Smtp-Source: AGHT+IE9YS5VOMOxDLagELffWKdlQ/MuEAgdHoXBVV9jt4hQB0W3plMJKFn1Y31LiPooNAlLFWVEcg== X-Received: by 2002:a5e:a819:0:b0:787:4fd:abda with SMTP id c25-20020a5ea819000000b0078704fdabdamr3175609ioa.12.1691770033695; Fri, 11 Aug 2023 09:07:13 -0700 (PDT) Received: from localhost.localdomain (71-211-152-221.hlrn.qwest.net. [71.211.152.221]) by smtp.gmail.com with ESMTPSA id gj20-20020a0566386a1400b0042af069eeefsm1119997jab.50.2023.08.11.09.07.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Aug 2023 09:07:13 -0700 (PDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [pushed] Test GNAT encodings in arr_acc_idx_w_gap.exp Date: Fri, 11 Aug 2023 10:07:06 -0600 Message-Id: <20230811160706.1616868-1-tromey@adacore.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: While working on a GNAT bug, I wanted to also test arr_acc_idx_w_gap.exp using GNAT encodings. When the GNAT change is ready, I plan to add a new case here. Tested on x86-64 Fedora 36. I am checking this in. --- gdb/testsuite/gdb.ada/arr_acc_idx_w_gap.exp | 80 +++++++++++---------- 1 file changed, 43 insertions(+), 37 deletions(-) diff --git a/gdb/testsuite/gdb.ada/arr_acc_idx_w_gap.exp b/gdb/testsuite/gdb.ada/arr_acc_idx_w_gap.exp index 397189487bb..4a1482b6d99 100644 --- a/gdb/testsuite/gdb.ada/arr_acc_idx_w_gap.exp +++ b/gdb/testsuite/gdb.ada/arr_acc_idx_w_gap.exp @@ -19,50 +19,56 @@ require allow_ada_tests standard_ada_testfile enum_with_gap_main -if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } { - return -1 -} +foreach_with_prefix scenario {all minimal} { + set flags [list debug additional_flags=-fgnat-encodings=$scenario] -clean_restart ${testfile} + if {[gdb_compile_ada "${srcfile}" "${binfile}-${scenario}" \ + executable $flags] != ""} { + return -1 + } -set bp_location [gdb_get_line_number "BREAK" ${testdir}/enum_with_gap_main.adb] -if {![runto "enum_with_gap_main.adb:$bp_location"]} { - return -} + clean_restart ${testfile}-${scenario} -gdb_test "print indexed_by_enum.all" \ - " = \\(lit1 => 1, 43, 42, 41\\)" -gdb_test "print s.all" \ - " = \"Hello!\"" + set bp_location [gdb_get_line_number "BREAK" \ + ${testdir}/enum_with_gap_main.adb] + if {![runto "enum_with_gap_main.adb:$bp_location"]} { + return + } -gdb_test "print indexed_by_enum'length" \ - " = 4" -gdb_test "print s'length" \ - " = 6" + gdb_test "print indexed_by_enum.all" \ + " = \\(lit1 => 1, 43, 42, 41\\)" + gdb_test "print s.all" \ + " = \"Hello!\"" -gdb_test "print indexed_by_enum'first" \ - " = lit1" -gdb_test "print s'first" \ - " = 1" + gdb_test "print indexed_by_enum'length" \ + " = 4" + gdb_test "print s'length" \ + " = 6" -gdb_test "print indexed_by_enum'last" \ - " = lit4" -gdb_test "print s'last" \ - " = 6" + gdb_test "print indexed_by_enum'first" \ + " = lit1" + gdb_test "print s'first" \ + " = 1" -gdb_test "print indexed_by_enum(lit2..lit4)" \ - " = \\(lit2 => 43, 42, 41\\)" -gdb_test "print s(2..4)" \ - " = \"ell\"" + gdb_test "print indexed_by_enum'last" \ + " = lit4" + gdb_test "print s'last" \ + " = 6" -gdb_test "print v" " = lit3" -gdb_test "print enum_subrange'pos(v)" " = 3" -gdb_test "print enum_subrange'val(3)" " = lit3" + gdb_test "print indexed_by_enum(lit2..lit4)" \ + " = \\(lit2 => 43, 42, 41\\)" + gdb_test "print s(2..4)" \ + " = \"ell\"" -gdb_test "print indexed_by_enum(lit2)" "43" -gdb_test "print s(2)" "101 'e'" + gdb_test "print v" " = lit3" + gdb_test "print enum_subrange'pos(v)" " = 3" + gdb_test "print enum_subrange'val(3)" " = lit3" -gdb_test "print enum_with_gaps'enum_rep(lit3)" " = 13" \ - "enum_rep" -gdb_test "print enum_with_gaps'enum_val(21)" " = lit4" \ - "enum_val" + gdb_test "print indexed_by_enum(lit2)" "43" + gdb_test "print s(2)" "101 'e'" + + gdb_test "print enum_with_gaps'enum_rep(lit3)" " = 13" \ + "enum_rep" + gdb_test "print enum_with_gaps'enum_val(21)" " = lit4" \ + "enum_val" +} -- 2.40.1