summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/funcspec-9.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-07-29 15:47:54 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-07-29 15:47:54 +0000
commit81bdf64f2035b8979549fc533915ea17d429dc9f (patch)
tree69e2b47b22500339535d6f5f37e3fca2350d4f3a /gcc/testsuite/gcc.target/i386/funcspec-9.c
parent7f1c23c2e7981438c251121d85cf5d807b9a4f5d (diff)
downloadgcc-81bdf64f2035b8979549fc533915ea17d429dc9f.tar.gz
2008-07-29 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r138226 [after tuple merge into trunk] some compiler probe stuff are missing * gcc/compiler-probe.h: more gimple, less tree * gcc/compiler-probe.c: incomplete merge. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@138247 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/funcspec-9.c')
-rw-r--r--gcc/testsuite/gcc.target/i386/funcspec-9.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/funcspec-9.c b/gcc/testsuite/gcc.target/i386/funcspec-9.c
new file mode 100644
index 00000000000..e6d19013101
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/funcspec-9.c
@@ -0,0 +1,36 @@
+/* Test whether using target specific options, we can generate SSE5 code. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=k8 -mfpmath=sse -msse2" } */
+
+extern void exit (int);
+
+#ifdef __SSE5__
+#warning "__SSE5__ should not be defined before #pragma GCC option."
+#endif
+
+#pragma GCC option (push)
+#pragma GCC option ("sse5,fused-madd")
+
+#ifndef __SSE5__
+#warning "__SSE5__ should have be defined after #pragma GCC option."
+#endif
+
+float
+flt_mul_add (float a, float b, float c)
+{
+ return (a * b) + c;
+}
+
+#pragma GCC option (pop)
+#ifdef __SSE5__
+#warning "__SSE5__ should not be defined after #pragma GCC pop option."
+#endif
+
+double
+dbl_mul_add (double a, double b, double c)
+{
+ return (a * b) + c;
+}
+
+/* { dg-final { scan-assembler "fmaddss" } } */
+/* { dg-final { scan-assembler "addsd" } } */