1 /* { dg-do run } */
2 /* { dg-options "-O" } */
3
4 extern void abort (void);
5
6 typedef struct {
7 short x;
8 } mytype_t;
9
10 mytype_t *__attribute__ ((noinline,weak))
11 some_func (void)
12 {
13 static mytype_t s;
14 return &s;
15 };
16
17 int main (void)
18 {
19 int y, y2;
20 mytype_t *shorter = some_func();
21 y = __builtin_arc_aligned (shorter, 2);
22 if (!y)
23 abort ();
24 y2 = __builtin_arc_aligned (shorter, 4);
25 if (y2)
26 abort ();
27 return 0;
28 }