Merge aosp-toolchain/gcc/gcc-4_9 changes.
[official-gcc.git] / gcc-4_9 / gcc / testsuite / gcc.target / mips / octeon-bbit-3.c
blobedb0c385030f2898bf1132b670023b2d995bec36
1 /* { dg-do compile } */
3 /* Force big-endian because for little-endian, combine generates this:
5 (if_then_else (ne (zero_extract:DI (subreg:DI (truncate:SI (reg:DI 196)) 0)
6 (const_int 1)
7 (const_int 0))
8 (const_int 0))
9 (label_ref 20)
10 (pc)))
12 which does not get recognized as a valid bbit pattern. The
13 middle-end should be able to simplify this further. */
14 /* { dg-options "-march=octeon -meb" } */
15 /* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
17 /* { dg-final { scan-assembler-times "\tbbit\[01\]\t|\tbgez\t|\tbltz\t" 2 } } */
18 /* { dg-final { scan-assembler-not "ext\t" } } */
20 void abort (void);
21 void abort1 (void);
22 void exit (int);
24 typedef unsigned long long ulong64;
26 typedef struct bitfield_s {
27 ulong64 a:1;
28 ulong64 b:29;
29 ulong64 c:1;
30 ulong64 d:15;
31 ulong64 f:18;
32 } bitfield_t;
34 void foo (bitfield_t*);
36 bitfield_t bar;
38 NOMIPS16 void
39 f ()
41 foo(&bar);
42 if (bar.a != 0x1)
43 abort ();
44 else if (!bar.c)
45 abort1 ();
46 else
47 exit (0);