From da076a8b12c17b10cfe2e6a9c5ea84aa0a0f5ebf Mon Sep 17 00:00:00 2001 From: "Maciej W. Rozycki" Date: Sat, 5 Dec 2020 18:26:25 +0000 Subject: [PATCH] VAX: Add tests for `sync_lock_test_and_set' and `sync_lock_release' Based on gcc.dg/pr61756.c. gcc/testsuite/ * gcc.target/vax/bbcci.c: New test. * gcc.target/vax/bbssi.c: New test. --- gcc/testsuite/gcc.target/vax/bbcci.c | 20 ++++++++++++++++++++ gcc/testsuite/gcc.target/vax/bbssi.c | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 gcc/testsuite/gcc.target/vax/bbcci.c create mode 100644 gcc/testsuite/gcc.target/vax/bbssi.c diff --git a/gcc/testsuite/gcc.target/vax/bbcci.c b/gcc/testsuite/gcc.target/vax/bbcci.c new file mode 100644 index 00000000000..f58d3a75e7d --- /dev/null +++ b/gcc/testsuite/gcc.target/vax/bbcci.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ + +#include + +extern volatile atomic_flag guard; + +void +try_atomic_flag_clear (void) +{ + atomic_flag_clear (&guard); +} + +/* Expect assembly like: + + jbcci $0,guard,.L2 +.L2: + + */ + +/* { dg-final { scan-assembler "\tjbcci \\\$0,guard," } } */ diff --git a/gcc/testsuite/gcc.target/vax/bbssi.c b/gcc/testsuite/gcc.target/vax/bbssi.c new file mode 100644 index 00000000000..65111e9bdf2 --- /dev/null +++ b/gcc/testsuite/gcc.target/vax/bbssi.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ + +#include + +extern volatile atomic_flag guard; + +void +try_atomic_flag_test_and_set (void) +{ + atomic_flag_test_and_set (&guard); +} + +/* Expect assembly like: + + jbssi $0,guard,.L1 +.L1: + + */ + +/* { dg-final { scan-assembler "\tjbssi \\\$0,guard," } } */ -- 2.30.2