Merge to HEAD at tree-cleanup-merge-20041024 .
[official-gcc.git] / gcc / testsuite / gcc.misc-tests / i386-pf-athlon-1.c
blob09a67d8342601d8e35e8f83c205d3ce40964004f
1 /* Test that the correct data prefetch instructions are generated for i386
2 variants that use 3DNow! prefetchw or SSE prefetch instructions with
3 locality hints. */
5 /* { dg-do compile { target i?86-*-* } } */
7 extern void exit (int);
9 char *msg = "howdy there";
11 void foo (char *p)
13 __builtin_prefetch (p, 0, 0);
14 __builtin_prefetch (p, 0, 1);
15 __builtin_prefetch (p, 0, 2);
16 __builtin_prefetch (p, 0, 3);
17 __builtin_prefetch (p, 1, 0);
18 __builtin_prefetch (p, 1, 1);
19 __builtin_prefetch (p, 1, 2);
20 __builtin_prefetch (p, 1, 3);
23 int main ()
25 foo (msg);
26 exit (0);
29 /* { dg-final { scan-assembler "prefetchw" } } */
30 /* { dg-final { scan-assembler "prefetchnta" } } */
31 /* { dg-final { scan-assembler "prefetcht" } } */