[Mesa-dev] [PATCH] nir/tests: Update the CF tests to not assume fake edges

Aaron Watry awatry at gmail.com
Sun Sep 4 01:06:27 UTC 2016


On Sat, Sep 3, 2016 at 1:59 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:

> In aad4f1550, we removed the concept of "fake" edges from NIR.  Now, if you
> have a block at the end of an infinite loop it really has no predecessors.
> This updates the unit tests to match.
>
>
Fixes `make check` for me.

--Aaron


> Signed-off-by: Jason Ekstrand <jason at jlekstrand.net>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97587
> ---
>  src/compiler/nir/tests/control_flow_tests.cpp | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/compiler/nir/tests/control_flow_tests.cpp
> b/src/compiler/nir/tests/control_flow_tests.cpp
> index b9379ef..db660fd 100644
> --- a/src/compiler/nir/tests/control_flow_tests.cpp
> +++ b/src/compiler/nir/tests/control_flow_tests.cpp
> @@ -120,7 +120,7 @@ TEST_F(nir_cf_test, delete_break_in_loop)
>      *                 // succs: block_1
>      *         }
>      *         block block_2:
> -    *         // preds: block_1
> +    *         // preds:
>      *         // succs: block_3
>      *         block block_3:
>      * }
> @@ -130,18 +130,18 @@ TEST_F(nir_cf_test, delete_break_in_loop)
>     EXPECT_EQ(block_1, block_0->successors[0]);
>     EXPECT_EQ(NULL,    block_0->successors[1]);
>     EXPECT_EQ(block_1, block_1->successors[0]); /* back to itself */
> -   EXPECT_EQ(block_2, block_1->successors[1]); /* fake successor */
> +   EXPECT_EQ(NULL,    block_1->successors[1]);
>     EXPECT_EQ(block_3, block_2->successors[0]);
>     EXPECT_EQ(NULL,    block_2->successors[1]);
>     EXPECT_EQ(NULL,    block_3->successors[0]);
>     EXPECT_EQ(NULL,    block_3->successors[1]);
>     EXPECT_EQ(0,       block_0->predecessors->entries);
>     EXPECT_EQ(2,       block_1->predecessors->entries);
> -   EXPECT_EQ(1,       block_2->predecessors->entries);
> +   EXPECT_EQ(0,       block_2->predecessors->entries);
>     EXPECT_EQ(1,       block_3->predecessors->entries);
>     EXPECT_TRUE(_mesa_set_search(block_1->predecessors, block_0));
>     EXPECT_TRUE(_mesa_set_search(block_1->predecessors, block_1));
> -   EXPECT_TRUE(_mesa_set_search(block_2->predecessors, block_1));
> +   EXPECT_FALSE(_mesa_set_search(block_2->predecessors, block_1));
>     EXPECT_TRUE(_mesa_set_search(block_3->predecessors, block_2));
>
>     nir_metadata_require(b.impl, nir_metadata_dominance);
> --
> 2.5.0.400.gff86faf
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160903/1352c813/attachment.html>


More information about the mesa-dev mailing list