public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Use __USER_LABEL_PREFIX__ in asm statement
@ 2016-06-07 13:58 H.J. Lu
  2016-06-10 12:27 ` H.J. Lu
  0 siblings, 1 reply; 2+ messages in thread
From: H.J. Lu @ 2016-06-07 13:58 UTC (permalink / raw)
  To: gcc-patches; +Cc: Uros Bizjak

A target may have a prefix in function symbol.  Update interrrupt tests
to use __USER_LABEL_PREFIX__ for function symbol in asm statement.

Tested on Linux and Darwin.  OK for trunk?

Thanks.

H.J.
----
	* gcc.dg/guality/pr68037-1.c (ASMNAME): New.
	(ASMNAME2): Likewise.
	(main): Replace fn in asm statement with ASMNAME ("fn").
	* gcc.dg/guality/pr68037-2.c: Likewise.
	* gcc.dg/guality/pr68037-3.c: Likewise.
	* gcc.dg/torture/pr68037-1.c: Likewise.
	* gcc.dg/torture/pr68037-2.c: Likewise.
	* gcc.dg/torture/pr68037-3.c: Likewise.

diff --git a/gcc/testsuite/gcc.dg/guality/pr68037-1.c b/gcc/testsuite/gcc.dg/guality/pr68037-1.c
index c3ea645..74f61ec 100644
--- a/gcc/testsuite/gcc.dg/guality/pr68037-1.c
+++ b/gcc/testsuite/gcc.dg/guality/pr68037-1.c
@@ -14,6 +14,8 @@ typedef unsigned int uword_t __attribute__ ((mode (__word__)));
 
 #define STRING(x)	XSTRING(x)
 #define XSTRING(x)	#x
+#define ASMNAME(cname)  ASMNAME2 (__USER_LABEL_PREFIX__, cname)
+#define ASMNAME2(prefix, cname) XSTRING (prefix) cname
 
 struct interrupt_frame
 {
@@ -53,7 +55,7 @@ main ()
 	push	$" STRING (CS) ";		\
 	push	$" STRING (IP) ";		\
 	push	$" STRING (ERROR) ";		\
-	jmp	fn");
+	jmp	 " ASMNAME ("fn"));
   return 0;
 }
 
diff --git a/gcc/testsuite/gcc.dg/guality/pr68037-2.c b/gcc/testsuite/gcc.dg/guality/pr68037-2.c
index 6f7e920..c3cd73d 100644
--- a/gcc/testsuite/gcc.dg/guality/pr68037-2.c
+++ b/gcc/testsuite/gcc.dg/guality/pr68037-2.c
@@ -13,6 +13,8 @@ typedef unsigned int uword_t __attribute__ ((mode (__word__)));
 
 #define STRING(x)	XSTRING(x)
 #define XSTRING(x)	#x
+#define ASMNAME(cname)  ASMNAME2 (__USER_LABEL_PREFIX__, cname)
+#define ASMNAME2(prefix, cname) XSTRING (prefix) cname
 
 struct interrupt_frame
 {
@@ -49,7 +51,7 @@ main ()
 	push	$" STRING (FLAGS) ";		\
 	push	$" STRING (CS) ";		\
 	push	$" STRING (IP) ";		\
-	jmp	fn");
+	jmp	 " ASMNAME ("fn"));
   return 0;
 }
 
diff --git a/gcc/testsuite/gcc.dg/guality/pr68037-3.c b/gcc/testsuite/gcc.dg/guality/pr68037-3.c
index 504a931..6e05472 100644
--- a/gcc/testsuite/gcc.dg/guality/pr68037-3.c
+++ b/gcc/testsuite/gcc.dg/guality/pr68037-3.c
@@ -16,6 +16,8 @@ typedef int aligned __attribute__((aligned(64)));
 
 #define STRING(x)	XSTRING(x)
 #define XSTRING(x)	#x
+#define ASMNAME(cname)  ASMNAME2 (__USER_LABEL_PREFIX__, cname)
+#define ASMNAME2(prefix, cname) XSTRING (prefix) cname
 
 struct interrupt_frame
 {
@@ -65,7 +67,7 @@ main ()
 	push	$" STRING (FLAGS) ";		\
 	push	$" STRING (CS) ";		\
 	push	$" STRING (IP) ";		\
-	jmp	fn");
+	jmp	 " ASMNAME ("fn"));
   return 0;
 }
 
diff --git a/gcc/testsuite/gcc.dg/torture/pr68037-1.c b/gcc/testsuite/gcc.dg/torture/pr68037-1.c
index 15fe08c..23d7c6f 100644
--- a/gcc/testsuite/gcc.dg/torture/pr68037-1.c
+++ b/gcc/testsuite/gcc.dg/torture/pr68037-1.c
@@ -14,6 +14,8 @@ typedef unsigned int uword_t __attribute__ ((mode (__word__)));
 
 #define STRING(x)	XSTRING(x)
 #define XSTRING(x)	#x
+#define ASMNAME(cname)  ASMNAME2 (__USER_LABEL_PREFIX__, cname)
+#define ASMNAME2(prefix, cname) XSTRING (prefix) cname
 
 struct interrupt_frame
 {
@@ -53,6 +55,6 @@ main ()
 	push	$" STRING (CS) ";		\
 	push	$" STRING (IP) ";		\
 	push	$" STRING (ERROR) ";		\
-	jmp	fn");
+	jmp	 " ASMNAME ("fn"));
   return 0;
 }
diff --git a/gcc/testsuite/gcc.dg/torture/pr68037-2.c b/gcc/testsuite/gcc.dg/torture/pr68037-2.c
index 00ba7d4..18f9844 100644
--- a/gcc/testsuite/gcc.dg/torture/pr68037-2.c
+++ b/gcc/testsuite/gcc.dg/torture/pr68037-2.c
@@ -13,6 +13,8 @@ typedef unsigned int uword_t __attribute__ ((mode (__word__)));
 
 #define STRING(x)	XSTRING(x)
 #define XSTRING(x)	#x
+#define ASMNAME(cname)  ASMNAME2 (__USER_LABEL_PREFIX__, cname)
+#define ASMNAME2(prefix, cname) XSTRING (prefix) cname
 
 struct interrupt_frame
 {
@@ -49,6 +51,6 @@ main ()
 	push	$" STRING (FLAGS) ";		\
 	push	$" STRING (CS) ";		\
 	push	$" STRING (IP) ";		\
-	jmp	fn");
+	jmp	 " ASMNAME ("fn"));
   return 0;
 }
diff --git a/gcc/testsuite/gcc.dg/torture/pr68037-3.c b/gcc/testsuite/gcc.dg/torture/pr68037-3.c
index abf8adb..86324f1 100644
--- a/gcc/testsuite/gcc.dg/torture/pr68037-3.c
+++ b/gcc/testsuite/gcc.dg/torture/pr68037-3.c
@@ -16,6 +16,8 @@ typedef int aligned __attribute__((aligned(64)));
 
 #define STRING(x)	XSTRING(x)
 #define XSTRING(x)	#x
+#define ASMNAME(cname)  ASMNAME2 (__USER_LABEL_PREFIX__, cname)
+#define ASMNAME2(prefix, cname) XSTRING (prefix) cname
 
 struct interrupt_frame
 {
@@ -65,6 +67,6 @@ main ()
 	push	$" STRING (FLAGS) ";		\
 	push	$" STRING (CS) ";		\
 	push	$" STRING (IP) ";		\
-	jmp	fn");
+	jmp	 " ASMNAME ("fn"));
   return 0;
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-10 12:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-07 13:58 [PATCH] Use __USER_LABEL_PREFIX__ in asm statement H.J. Lu
2016-06-10 12:27 ` H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).