Merge aosp-toolchain/gcc/gcc-4_9 changes.
[official-gcc.git] / gcc-4_9 / gcc / testsuite / gcc.target / nios2 / custom-fp-4.c
blob6c5f2a24be43f50c8c100c89370cc0e553ecb7f2
1 /* Test conflict between pragma and attribute specification of custom
2 instructions. */
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 <stdio.h>
11 #include <math.h>
13 /* This test case is expected to cause an error because GCC does not know
14 how to merge different custom instruction attribute sets. The extern
15 declaration sees the options specified by both the pragma and the function
16 attribute, but the function definition sees only the pragma options. */
18 #pragma GCC target ("custom-fmaxs=246")
20 extern void
21 custom_fp (float operand_a, float operand_b, float *result)
22 __attribute__ ((target ("custom-fmins=247")));
24 void
25 custom_fp (float operand_a, float operand_b, float *result)
26 { /* { dg-error "conflicting" } */
27 result[0] = fmaxf (operand_a, operand_b);
28 result[1] = fminf (operand_a, operand_b);