This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, ARM] attribute target (thumb,arm) [5/6] respin (4th)


Implements the hooks for #pragma GCC target

A test included to check that macros were correctly defined/undefined on
pragma regions.

Thanks

Christian
2014-09-23  Christian Bruel  <christian.bruel@st.com>

	* config/arm/arm.h (REGISTER_TARGET_PRAGMAS):
	 Call arm_register_target_pragmas.
	* config/arm/arm-protos.h (arm_register_target_pragmas): Declare.
	* config/arm/arm-c.c (arm_register_target_pragmas): New function.
	(arm_pragma_target_parse): Likewise.

diff '--exclude=.svn' -ruN gnu_trunk.p4/gcc/gcc/testsuite/gcc.target/arm/pragma_attribute.c gnu_trunk.p5/gcc/gcc/testsuite/gcc.target/arm/pragma_attribute.c
--- gnu_trunk.p4/gcc/gcc/testsuite/gcc.target/arm/pragma_attribute.c	1970-01-01 01:00:00.000000000 +0100
+++ gnu_trunk.p5/gcc/gcc/testsuite/gcc.target/arm/pragma_attribute.c	2015-05-06 14:37:31.215314738 +0200
@@ -0,0 +1,35 @@
+/* Test for #prama target macros.  */
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_thumb1_ok } */
+
+#pragma GCC target ("thumb")
+
+#ifndef __thumb__
+#error "__thumb__ is not defined"
+#endif
+
+#ifdef __thumb2__
+#ifndef __ARM_32BIT_STATE
+#error  "__ARM_32BIT_STATE is not defined"
+#endif
+#else /* thumb1 */
+#ifdef __ARM_32BIT_STATE
+#error  "__ARM_32BIT_STATE is defined"
+#endif
+#endif /* thumb1 */
+
+#pragma GCC target ("arm")
+
+#ifdef __thumb__
+#error "__thumb__ is defined"
+#endif
+
+#if defined (__thumb2__) || defined (__thumb1__)
+#error "thumb is defined"
+#endif 
+
+#ifndef __ARM_32BIT_STATE
+#error  "__ARM_32BIT_STATE is not defined"
+#endif
+
+#pragma GCC reset_options

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]