(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
nios2/
custom-fp-inline-4.c
       1  /* Test that you cannot inline a function with custom insn attributes into
       2     one with incompatible attributes.  */
       3  
       4  /* { dg-do compile } */
       5  /* { dg-options "-O1 -ffinite-math-only" } */
       6  
       7  /* -O1 in the options is significant.  Without it FP operations may not be
       8     optimized to custom instructions.  */
       9  
      10  #include <math.h>
      11  
      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)  /* { dg-error "target specific option mismatch" } */
      16  {
      17    result[0] = fmaxf (operand_a, operand_b);
      18    result[1] = fminf (operand_a, operand_b);
      19  }
      20  
      21  extern void
      22  custom_fp (float operand_a, float operand_b, float *result)
      23    __attribute__ ((target ("custom-fmaxs=200,custom-fmins=201")));
      24  
      25  void
      26  custom_fp (float operand_a, float operand_b, float *result)
      27  {
      28    custom_fp1 (operand_a, operand_b, result);
      29  }