summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.misc-tests/i386-pf-athlon-1.c
diff options
context:
space:
mode:
authorJanis Johnson <janis187@us.ibm.com>2002-01-15 17:30:28 +0000
committerJanis Johnson <janis@gcc.gnu.org>2002-01-15 17:30:28 +0000
commit441f52642d3247e9ee95f2608f94b4533bcde168 (patch)
treed46597272ce323319586bcb3ec895d145695fdb1 /gcc/testsuite/gcc.misc-tests/i386-pf-athlon-1.c
parent82598228f08d373948f195d474ccc6a7aa9b2aab (diff)
downloadgcc-441f52642d3247e9ee95f2608f94b4533bcde168.tar.gz
i386-prefetch.exp: New.
* gcc.misc-tests/i386-prefetch.exp: New. * gcc.misc-tests/i386-pf-3dnow-1.c: New test. * gcc.misc-tests/i386-pf-athlon-1.c: New test. * gcc.misc-tests/i386-pf-none-1.c: New test. * gcc.misc-tests/i386-pf-sse-1.c: New test. From-SVN: r48876
Diffstat (limited to 'gcc/testsuite/gcc.misc-tests/i386-pf-athlon-1.c')
-rw-r--r--gcc/testsuite/gcc.misc-tests/i386-pf-athlon-1.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.misc-tests/i386-pf-athlon-1.c b/gcc/testsuite/gcc.misc-tests/i386-pf-athlon-1.c
new file mode 100644
index 00000000000..301e8b7ed9f
--- /dev/null
+++ b/gcc/testsuite/gcc.misc-tests/i386-pf-athlon-1.c
@@ -0,0 +1,29 @@
+/* Test that the correct data prefetch instructions are generated for i386
+ variants that use 3DNow! prefetchw or SSE prefetch instructions with
+ locality hints. */
+
+/* { dg-do compile { target i?86-*-* } } */
+
+char *msg = "howdy there";
+
+void foo (char *p)
+{
+ __builtin_prefetch (p, 0, 0);
+ __builtin_prefetch (p, 0, 1);
+ __builtin_prefetch (p, 0, 2);
+ __builtin_prefetch (p, 0, 3);
+ __builtin_prefetch (p, 1, 0);
+ __builtin_prefetch (p, 1, 1);
+ __builtin_prefetch (p, 1, 2);
+ __builtin_prefetch (p, 1, 3);
+}
+
+int main ()
+{
+ foo (msg);
+ exit (0);
+}
+
+/* { dg-final { scan-assembler "prefetchw" } } */
+/* { dg-final { scan-assembler "prefetchnta" } } */
+/* { dg-final { scan-assembler "prefetcht" } } */