diff mbox

[ARM] attribute target (thumb,arm) [5/6]

Message ID 546CA15F.3010307@st.com
State New
Headers show

Commit Message

Christian Bruel Nov. 19, 2014, 1:55 p.m. UTC
Implements the hooks for #pragma GCC target

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

Thanks

Christian
diff mbox

Patch

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

	* gcc.target/arm/pragma_attribute.c: New test.

diff '--exclude=ChangeLog*' '--exclude=.svn' '--exclude=*~' '--exclude=#*#' -rupN e/gcc/gcc/testsuite/gcc.target/arm/pragma_attribute.c f/gcc/gcc/testsuite/gcc.target/arm/pragma_attribute.c
--- e/gcc/gcc/testsuite/gcc.target/arm/pragma_attribute.c	1970-01-01 01:00:00.000000000 +0100
+++ f/gcc/gcc/testsuite/gcc.target/arm/pragma_attribute.c	2014-11-18 11:13:19.000000000 +0100
@@ -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