i386: Fix some ISA bit test in option_override
[official-gcc.git] / gcc / testsuite / gcc.target / arm / pragma_attribute.c
bloba11a8116b1a75128399d5476b2d845895b8e4da4
1 /* Test for #prama target macros. */
2 /* { dg-do compile } */
3 /* { dg-require-effective-target arm_thumb1_ok } */
4 /* { dg-require-effective-target arm_arm_ok } */
6 #pragma GCC target ("thumb")
8 #ifndef __thumb__
9 #error "__thumb__ is not defined"
10 #endif
12 #ifdef __thumb2__
13 #ifndef __ARM_32BIT_STATE
14 #error "__ARM_32BIT_STATE is not defined"
15 #endif
16 #else /* thumb1 */
17 #ifdef __ARM_32BIT_STATE
18 #error "__ARM_32BIT_STATE is defined"
19 #endif
20 #endif /* thumb1 */
22 #pragma GCC target ("arm")
24 #ifdef __thumb__
25 #error "__thumb__ is defined"
26 #endif
28 #if defined (__thumb2__) || defined (__thumb1__)
29 #error "thumb is defined"
30 #endif
32 #ifndef __ARM_32BIT_STATE
33 #error "__ARM_32BIT_STATE is not defined"
34 #endif
36 #pragma GCC reset_options