summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/mips/octeon-exts-2.c
blob: fc5df639d02bc4d64586da7cc2b4227191ef681f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* { dg-do compile } */
/* { dg-options "-O -march=octeon -meb" } */
/* { dg-final { scan-assembler-times "\texts\t" 4 } } */

struct bar
{
  unsigned long long a:1;
  long long b:14;
  unsigned long long c:48;
  long long d:1;
};

NOMIPS16 int
f1 (struct bar *s, int a)
{
  return (int) s->b + a;
}

NOMIPS16 char
f2 (struct bar *s)
{
  return s->d + 1;
}

NOMIPS16 int
f3 ()
{
  struct bar s;
  asm ("" : "=r"(s));
  return (int) s.b + 1;
}

NOMIPS16 long long
f4 (struct bar *s)
{
  return s->d;
}