2018-02-09 Sebastian Perta <sebastian.perta@renesas.com>
[official-gcc.git] / gcc / testsuite / gcc.target / arm / attr_thumb-static2.c
blob77454343b2306b86bfad06d78d76b94df31b1505
1 /* Check interwork between static functions for thumb2. */
3 /* { dg-do compile } */
4 /* { dg-require-effective-target arm_arch_v7a_ok } */
5 /* { dg-options "-O0 -march=armv7-a" } */
7 struct _NSPoint
9 float x;
10 float y;
13 typedef struct _NSPoint NSPoint;
15 static NSPoint
16 __attribute__ ((target("arm")))
17 NSMakePoint (float x, float y)
19 NSPoint point;
20 point.x = x;
21 point.y = y;
22 return point;
25 static NSPoint
26 __attribute__ ((target("thumb")))
27 RelativePoint (NSPoint point, NSPoint refPoint)
29 return NSMakePoint (refPoint.x + point.x, refPoint.y + point.y);
32 NSPoint
33 __attribute__ ((target("arm")))
34 g(NSPoint refPoint)
36 float pointA, pointB;
37 return RelativePoint (NSMakePoint (0, pointA), refPoint);
40 /* { dg-final { scan-assembler-times "blx" 2 } } */