simple tgmath test
[libm] / test / tgmath / t.c
diff --git a/test/tgmath/t.c b/test/tgmath/t.c
new file mode 100644 (file)
index 0000000..836add5
--- /dev/null
@@ -0,0 +1,26 @@
+#include "tgmath.h"
+#include <stdio.h>
+#include <stdint.h>
+
+
+int main()
+{
+       long double i = sin(1);
+       long double d = sin(1.0);
+       long double f = sin(1.0f);
+       long double l = sin(1.0l);
+
+       long double complex dc = sin(1.0+0*I);
+       long double complex fc = sin(1.0f+0*I);
+       long double complex lc = sin(1.0l+0*I);
+
+       printf("i  %2u %La\n", sizeof sin(1), i);
+       printf("d  %2u %La\n", sizeof sin(1.0), d);
+       printf("f  %2u %La\n", sizeof sin(1.0f), f);
+       printf("l  %2u %La\n", sizeof sin(1.0l), l);
+
+       printf("dc %2u %La %La\n", sizeof sin(1.0+0*I), creall(dc), cimagl(dc));
+       printf("fc %2u %La %La\n", sizeof sin(1.0f+0*I), creall(fc), cimagl(fc));
+       printf("lc %2u %La %La\n", sizeof sin(1.0l+0*I), creall(lc), cimagl(lc));
+       return 0;
+}