[14/31] VAX: Add tests for `sync_lock_test_and_set' and `sync_lock_release'

Message ID alpine.LFD.2.21.2011200250240.656242@eddie.linux-mips.org
State New
Headers show
Series
  • VAX: Bring the port up to date (yes, MODE_CC conversion is included)
Related show

Commit Message

Maciej W. Rozycki Nov. 20, 2020, 3:35 a.m.
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

-- 
2.11.0

Comments

Jeff Law via Gcc-patches Nov. 20, 2020, 11:22 p.m. | #1
On 11/19/20 8:35 PM, Maciej W. Rozycki wrote:
> Based on gcc.dg/pr61756.c.

>

> 	gcc/testsuite/

> 	* gcc.target/vax/bbcci.c: New test.

> 	* gcc.target/vax/bbssi.c: New test.

OK
jeff

Patch

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 <stdatomic.h>
+
+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 <stdatomic.h>
+
+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," } } */