PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / 20080723-1.c
bloba2ed5bf86dfd8bfa10146afc63c5e8bde9a825d8
1 /* { dg-do run } */
2 /* { dg-options "-O2" } */
4 extern void abort (void);
5 extern void exit (int);
7 static inline __attribute__((always_inline))
8 void
9 prefetch (void *x)
11 asm volatile("prefetcht0 %0" : : "m" (*(unsigned long *)x));
14 struct hlist_head
16 struct hlist_node *first;
19 struct hlist_node
21 struct hlist_node *next;
22 unsigned long i_ino;
25 struct hlist_node * find_inode_fast(struct hlist_head *head, unsigned long ino)
27 struct hlist_node *node;
29 for (node = head->first;
30 node && (prefetch (node->next), 1);
31 node = node->next)
33 if (node->i_ino == ino)
34 break;
36 return node ? node : 0;
39 struct hlist_node g2;
40 struct hlist_node g1 = { &g2 };
41 struct hlist_head h = { &g1 };
43 int
44 main()
46 if (find_inode_fast (&h, 1) != 0)
47 abort ();
48 exit (0);