Some targets (eg arm-none-uclinuxfdpiceabi) do not support Thumb-1,
and since the testcase forces -march=armv8-m.base, we need to check
whether this option is actually supported.
Using dg-add-options arm_arch_v8m_base ensure that we pass -mthumb as
needed too.
2021-05-19 Christophe Lyon <christophe.lyon@linaro.org>
PR target/99977
gcc/testsuite/
* gcc.target/arm/pr99977.c: Require arm_arch_v8m_base.
/* { dg-do compile } */
-/* { dg-options "-march=armv8-m.base -mfloat-abi=soft -O2" } */
+/* { dg-require-effective-target arm_arch_v8m_base_ok } */
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_arch_v8m_base } */
_Bool f1(int *p) { return __sync_bool_compare_and_swap (p, -1, 2); }
_Bool f2(int *p) { return __sync_bool_compare_and_swap (p, -8, 2); }
int g1(int *p) { return __sync_val_compare_and_swap (p, -1, 2); }