aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/arc/builtin_arc_aligned-2.c
blob: d48a915b8bd7f4a18539cf6170c76a9833218181 (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
/* { dg-do run } */
/* { dg-options "-O" } */

extern void abort (void);

typedef struct {
  short x;
} mytype_t;

mytype_t *__attribute__  ((noinline,weak))
some_func (void)
{
  static mytype_t s;
  return &s;
};

int main (void)
{
  int y, y2;
  mytype_t *shorter = some_func();
  y = __builtin_arc_aligned (shorter, 2);
  if (!y)
    abort ();
  y2 = __builtin_arc_aligned (shorter, 4);
  if (y2)
    abort ();
  return 0;
}