From 1bc5aee63eb72b341f506ad058502cd0361f0d10 Mon Sep 17 00:00:00 2001 From: Ben Cheng Date: Tue, 25 Mar 2014 22:37:19 -0700 Subject: Initial checkin of GCC 4.9.0 from trunk (r208799). Change-Id: I48a3c08bb98542aa215912a75f03c0890e497dba --- .../gcc/testsuite/gcc.target/nios2/custom-fp-6.c | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/nios2/custom-fp-6.c (limited to 'gcc-4.9/gcc/testsuite/gcc.target/nios2/custom-fp-6.c') diff --git a/gcc-4.9/gcc/testsuite/gcc.target/nios2/custom-fp-6.c b/gcc-4.9/gcc/testsuite/gcc.target/nios2/custom-fp-6.c new file mode 100644 index 000000000..7540c57b2 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/nios2/custom-fp-6.c @@ -0,0 +1,30 @@ +/* Test conflict between pragma and attribute specification of custom + instructions. */ + +/* { dg-do compile } */ +/* { dg-options "-O1 -ffinite-math-only" } */ + +/* -O1 in the options is significant. Without it FP operations may not be + optimized to custom instructions. */ + +#include +#include + +/* This test case is expected to cause an error because GCC does not know + how to merge different custom instruction attribute sets, even if they + do not overlap. */ + +extern void +custom_fp (float operand_a, float operand_b, float *result) + __attribute__ ((target ("custom-fmaxs=246"))); + +extern void +custom_fp (float operand_a, float operand_b, float *result) + __attribute__ ((target ("custom-fmins=247"))); /* { dg-error "conflicting" } */ + +void +custom_fp (float operand_a, float operand_b, float *result) +{ + result[0] = fmaxf (operand_a, operand_b); + result[1] = fminf (operand_a, operand_b); +} -- cgit v1.2.3