Debian Codegraph @

gcc/testsuite/gcc.target/arm/attr_thumb-static2.c

raw
1 /* Check interwork between static functions for thumb2. */
2
3 /* { dg-do compile } */
4 /* { dg-require-effective-target arm_arch_v7a_ok } */
5 /* { dg-options "-O0 -march=armv7-a+fp" } */
6
7 struct _NSPoint
8 {
9 float x;
10 float y;
11 };
12
13 typedef struct _NSPoint NSPoint;
14
15 static NSPoint
16 __attribute__ ((target("arm")))
17 NSMakePoint (float x, float y)
18 {
19 NSPoint point;
20 point.x = x;
21 point.y = y;
22 return point;
23 }
24
25 static NSPoint
26 __attribute__ ((target("thumb")))
27 RelativePoint (NSPoint point, NSPoint refPoint)
28 {
29 return NSMakePoint (refPoint.x + point.x, refPoint.y + point.y);
30 }
31
32 NSPoint
33 __attribute__ ((target("arm")))
34 g(NSPoint refPoint)
35 {
36 float pointA, pointB;
37 return RelativePoint (NSMakePoint (0, pointA), refPoint);
38 }
39
40 /* { dg-final { scan-assembler-times "blx" 2 } } */