Fortran: fix dependency checks for inquiry refs [PR115039]
[official-gcc.git] / gcc / testsuite / gcc.target / nios2 / custom-fp-inline-1.c
blob43715e55fcd749b572607814b869b495cb499cbe
1 /* Test that you can inline a function with custom insn attributes into
2 one with the same attributes. */
4 /* { dg-do compile } */
5 /* { dg-options "-O1 -ffinite-math-only" } */
7 /* -O1 in the options is significant. Without it FP operations may not be
8 optimized to custom instructions. */
10 #include <math.h>
12 static inline
13 __attribute__ ((always_inline, target ("custom-fmaxs=246,custom-fmins=247")))
14 void
15 custom_fp1 (float operand_a, float operand_b, float *result)
18 result[0] = fmaxf (operand_a, operand_b);
19 result[1] = fminf (operand_a, operand_b);
22 extern void
23 custom_fp (float operand_a, float operand_b, float *result)
24 __attribute__ ((target ("custom-fmaxs=246,custom-fmins=247")));
26 void
27 custom_fp (float operand_a, float operand_b, float *result)
29 custom_fp1 (operand_a, operand_b, result);
32 /* { dg-final { scan-assembler "custom\\t246, .* # fmaxs .*" } } */
33 /* { dg-final { scan-assembler "custom\\t247, .* # fmins .*" } } */