1 /* Test that duplicate declarations with the same custom insn attributes
2 don't cause an error. */
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. */
13 /* This test case is expected to cause an error because GCC does not know
14 how to merge different custom instruction attribute sets, even if they
18 custom_fp (float operand_a
, float operand_b
, float *result
)
19 __attribute__ ((target ("custom-fmaxs=246,custom-fmins=247")));
22 custom_fp (float operand_a
, float operand_b
, float *result
)
23 __attribute__ ((target ("custom-fmaxs=246,custom-fmins=247")));
26 custom_fp (float operand_a
, float operand_b
, float *result
)
28 result
[0] = fmaxf (operand_a
, operand_b
);
29 result
[1] = fminf (operand_a
, operand_b
);
32 /* { dg-final { scan-assembler "custom\\t246, .* # fmaxs .*" } } */
33 /* { dg-final { scan-assembler "custom\\t247, .* # fmins .*" } } */