mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete.
[official-gcc.git] / gcc / testsuite / gcc.dg / gcc-have-sync-compare-and-swap.c
blobfaed818d50052501bf67b078ff0dcfbeee479069
1 /* { dg-do link } */
2 /* MIPS only supports these built-in functions for non-MIPS16 mode, and
3 -mflip-mips16 will change the mode of some functions to be different
4 from the command-line setting. */
5 /* { dg-skip-if "" { mips*-*-* } { "-mflip-mips16" } { "" } } */
7 void f1()
9 #ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
10 typedef int __attribute__ ((__mode__ (__QI__))) qi_int_type;
11 qi_int_type qi_int;
12 __sync_bool_compare_and_swap (&qi_int, (qi_int_type)0, (qi_int_type)1);
13 #endif
16 void f2()
18 #ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2
19 typedef int __attribute__ ((__mode__ (__HI__))) hi_int_type;
20 hi_int_type hi_int;
21 __sync_bool_compare_and_swap (&hi_int, (hi_int_type)0, (hi_int_type)1);
22 #endif
25 void f4()
27 #ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
28 typedef int __attribute__ ((__mode__ (__SI__))) si_int_type;
29 si_int_type si_int;
30 __sync_bool_compare_and_swap (&si_int, (si_int_type)0, (si_int_type)1);
31 #endif
34 void f8()
36 #ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
37 typedef int __attribute__ ((__mode__ (__DI__))) di_int_type;
38 di_int_type di_int;
39 __sync_bool_compare_and_swap (&di_int, (di_int_type)0, (di_int_type)1);
40 #endif
43 void f16()
45 #ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16
46 typedef int __attribute__ ((__mode__ (__TI__))) ti_int_type;
47 ti_int_type ti_int;
48 __sync_bool_compare_and_swap (&ti_int, (ti_int_type)0, (ti_int_type)1);
49 #endif
52 int main()
54 f1();
55 f2();
56 f4();
57 f8();
58 f16();
59 return 0;