Use __asm__ rather than asm in gold testsuite

Message ID 20200616124438.GB15692@bubble.grove.modra.org
State New
Headers show
Series
  • Use __asm__ rather than asm in gold testsuite
Related show

Commit Message

Cui, Lili via Binutils June 16, 2020, 12:44 p.m.
gcc4 -std=c99
discard_locals_test.c:28:6: error: expected declaration specifiers or
‘...’ before string constant
 asm (".Lshould_be_discarded:");
      ^

	* testsuite/discard_locals_test.c: Replace uses of asm with __asm__.
	* testsuite/discard_locals_relocatable_test.c: Likewise.


-- 
Alan Modra
Australia Development Lab, IBM

Comments

Cui, Lili via Binutils June 16, 2020, 5:42 p.m. | #1
>         * testsuite/discard_locals_test.c: Replace uses of asm with __asm__.

>         * testsuite/discard_locals_relocatable_test.c: Likewise.


Not sure if you committed as obvious or not, but just in case, this is
OK. Thanks!

-cary

Patch

diff --git a/gold/testsuite/discard_locals_relocatable_test.c b/gold/testsuite/discard_locals_relocatable_test.c
index 54f689af0c..543b99757d 100644
--- a/gold/testsuite/discard_locals_relocatable_test.c
+++ b/gold/testsuite/discard_locals_relocatable_test.c
@@ -29,14 +29,14 @@ 
 /* Local symbol format for generic ELF target. 
    Use GCC -Wa,-L option to preserve this local symbol
    in the output object file. */
-asm (".Lshould_be_discarded:");
+__asm__ (".Lshould_be_discarded:");
 
 #ifdef __powerpc__
 /* Test wants to keep one local.  Satisfy it.  */
 #ifdef __powerpc64__
-asm (".reloc 0,R_PPC64_NONE,.LC0");
+__asm__ (".reloc 0,R_PPC64_NONE,.LC0");
 #else
-asm (".reloc 0,R_PPC_NONE,.LC0");
+__asm__ (".reloc 0,R_PPC_NONE,.LC0");
 #endif
 #endif
 
diff --git a/gold/testsuite/discard_locals_test.c b/gold/testsuite/discard_locals_test.c
index c27ea35e91..96c5651156 100644
--- a/gold/testsuite/discard_locals_test.c
+++ b/gold/testsuite/discard_locals_test.c
@@ -25,11 +25,11 @@ 
    main program should override the shared library symbol.  */
 
 /* Local symbol format for generic ELF target. */
-asm (".Lshould_be_discarded:");
+__asm__ (".Lshould_be_discarded:");
 
 #ifdef __i386__
 /* Additional local symbol format for the i386 target. */
-asm (".Xshould_be_discarded:");
+__asm__ (".Xshould_be_discarded:");
 #endif
 
 int
@@ -37,4 +37,3 @@  main (void)
 {
   return 0;
 }
-