From 5119c7927c70b02ab9768b30f40564480f556432 Mon Sep 17 00:00:00 2001 From: Wilco Dijkstra Date: Fri, 8 Mar 2024 15:01:15 +0000 Subject: [PATCH] ARM: Fix builtin-bswap-1.c test [PR113915] On Thumb-2 the use of CBZ blocks conditional execution, so change the test to compare with a non-zero value. gcc/testsuite/ChangeLog: PR target/113915 * gcc.target/arm/builtin-bswap.x: Fix test to avoid emitting CBZ. --- gcc/testsuite/gcc.target/arm/builtin-bswap.x | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/testsuite/gcc.target/arm/builtin-bswap.x b/gcc/testsuite/gcc.target/arm/builtin-bswap.x index c96dbe6329c4..dc8f910e0007 100644 --- a/gcc/testsuite/gcc.target/arm/builtin-bswap.x +++ b/gcc/testsuite/gcc.target/arm/builtin-bswap.x @@ -10,7 +10,7 @@ extern short foos16 (short); short swaps16_cond (short x, int y) { short z = x; - if (y) + if (y != 2) z = __builtin_bswap16 (x); return foos16 (z); } @@ -27,7 +27,7 @@ extern unsigned short foou16 (unsigned short); unsigned short swapu16_cond (unsigned short x, int y) { unsigned short z = x; - if (y) + if (y != 2) z = __builtin_bswap16 (x); return foou16 (z); } @@ -43,7 +43,7 @@ extern int foos32 (int); int swaps32_cond (int x, int y) { int z = x; - if (y) + if (y != 2) z = __builtin_bswap32 (x); return foos32 (z); } @@ -60,7 +60,7 @@ extern unsigned int foou32 (unsigned int); unsigned int swapsu2 (unsigned int x, int y) { int z = x; - if (y) + if (y != 2) z = __builtin_bswap32 (x); return foou32 (z); } -- 2.47.2