[v2] ARM: add test case for -masm-syntax-unified (PR88648)

Message ID 1f11ba49289e6e7932b24188de25d1feca581a86.1546985312.git.stefan@agner.ch
State New
Headers show
Series
  • [v2] ARM: add test case for -masm-syntax-unified (PR88648)
Related show

Commit Message

Stefan Agner Jan. 8, 2019, 10:09 p.m.
Add a test case to check whether -masm-syntax-unified is indeed
emitting the inline assembler with .syntax unified.

	gcc/testsuite/ChangeLog
	* gcc.target/arm/pr88648-asm-syntax-unified.c: add test to
	  check if -masm-syntax-unified gets applied properly
---
 .../gcc.target/arm/pr88648-asm-syntax-unified.c    | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 gcc/testsuite/gcc.target/arm/pr88648-asm-syntax-unified.c

-- 
2.20.1

Patch

diff --git a/gcc/testsuite/gcc.target/arm/pr88648-asm-syntax-unified.c b/gcc/testsuite/gcc.target/arm/pr88648-asm-syntax-unified.c
new file mode 100644
index 00000000000..251b4d5bc9d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr88648-asm-syntax-unified.c
@@ -0,0 +1,14 @@ 
+/* Test for unified syntax assembly generation.  */
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_arch_v7a_ok } */
+/* { dg-add-options arm_arch_v7a } */
+/* { dg-options "-marm -march=armv7-a -masm-syntax-unified" } */
+
+void test ()
+{
+  asm("nop");
+}
+
+/* { dg-final { scan-assembler-times {\.syntax\sunified} 3 } } */
+/* { dg-final { scan-assembler-not {\.syntax\sdivided} } } */
+