From: Richard Smith Date: Thu, 9 May 2013 18:33:50 +0000 (+0000) Subject: Add testcase missed from r181527. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=de8e4435d61cd4b5e23e80f53fc33bc00dcef1d4;p=clang Add testcase missed from r181527. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181531 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Headers/tgmath.c b/test/Headers/tgmath.c new file mode 100644 index 0000000000..a95e33a53c --- /dev/null +++ b/test/Headers/tgmath.c @@ -0,0 +1,41 @@ +// RUN: %clang -fsyntax-only %s + +#ifdef __STDC_HOSTED__ + +#include + +float f; +double d; +long double l; + +float complex fc; +double complex dc; +long double complex lc; + +// creal + +_Static_assert(sizeof(creal(f)) == sizeof(f), ""); +_Static_assert(sizeof(creal(d)) == sizeof(d), ""); +_Static_assert(sizeof(creal(l)) == sizeof(l), ""); + +_Static_assert(sizeof(creal(fc)) == sizeof(f), ""); +_Static_assert(sizeof(creal(dc)) == sizeof(d), ""); +_Static_assert(sizeof(creal(lc)) == sizeof(l), ""); + +// fabs + +_Static_assert(sizeof(fabs(f)) == sizeof(f), ""); +_Static_assert(sizeof(fabs(d)) == sizeof(d), ""); +_Static_assert(sizeof(fabs(l)) == sizeof(l), ""); + +_Static_assert(sizeof(fabs(fc)) == sizeof(f), ""); +_Static_assert(sizeof(fabs(dc)) == sizeof(d), ""); +_Static_assert(sizeof(fabs(lc)) == sizeof(l), ""); + +// logb + +_Static_assert(sizeof(logb(f)) == sizeof(f), ""); +_Static_assert(sizeof(logb(d)) == sizeof(d), ""); +_Static_assert(sizeof(logb(l)) == sizeof(l), ""); + +#endif