From a507c0280209cb8e9a2b8e64aabf1344fb83a288 Mon Sep 17 00:00:00 2001 From: ghazi Date: Wed, 21 Apr 2010 06:26:22 +0000 Subject: [PATCH] * gcc.dg/torture/builtin-cproj-3.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158588 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/torture/builtin-cproj-3.c | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/torture/builtin-cproj-3.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9750baa2359..18bf9e1a965 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2010-04-21 Kaveh R. Ghazi + + * gcc.dg/torture/builtin-cproj-3.c: New. + 2010-04-20 Jason Merrill PR c++/9335 diff --git a/gcc/testsuite/gcc.dg/torture/builtin-cproj-3.c b/gcc/testsuite/gcc.dg/torture/builtin-cproj-3.c new file mode 100644 index 00000000000..fe143b9ea5b --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/builtin-cproj-3.c @@ -0,0 +1,25 @@ +/* Copyright (C) 2010 Free Software Foundation. + + Check the runtime behavior of the C library's cproj() function and + whether it follows the standard. Versions of GLIBC through 2.11.1 + had an incorrect implementation which will conflict with GCC's + builtin cproj(). GLIBC 2.12+ should be okay. + + Origin: Kaveh R. Ghazi, April 20, 2010. */ + +/* { dg-do run } */ +/* { dg-options "-fno-builtin-cproj" } */ +/* { dg-add-options c99_runtime } */ +/* { dg-require-effective-target c99_runtime } */ + +extern void abort(void); +extern void exit(int); +double _Complex cproj(double _Complex); + +int main (void) +{ + if (cproj (2+3i) != 2+3i) + abort(); + + exit(0); +} -- 2.11.0