PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / arm / pragma_attribute.c
blob12afc97ed50a8b97096102ed6e2349997b37350a
1 /* Test for #prama target macros. */
2 /* { dg-do compile } */
3 /* { dg-require-effective-target arm_thumb1_ok } */
5 #pragma GCC target ("thumb")
7 #ifndef __thumb__
8 #error "__thumb__ is not defined"
9 #endif
11 #ifdef __thumb2__
12 #ifndef __ARM_32BIT_STATE
13 #error "__ARM_32BIT_STATE is not defined"
14 #endif
15 #else /* thumb1 */
16 #ifdef __ARM_32BIT_STATE
17 #error "__ARM_32BIT_STATE is defined"
18 #endif
19 #endif /* thumb1 */
21 #pragma GCC target ("arm")
23 #ifdef __thumb__
24 #error "__thumb__ is defined"
25 #endif
27 #if defined (__thumb2__) || defined (__thumb1__)
28 #error "thumb is defined"
29 #endif
31 #ifndef __ARM_32BIT_STATE
32 #error "__ARM_32BIT_STATE is not defined"
33 #endif
35 #pragma GCC reset_options