* gcc.dg/980709-1.c: New test.

From-SVN: r21018
This commit is contained in:
Jeffrey A Law 1998-07-08 23:40:33 +00:00 committed by Jeff Law
parent 752e74f910
commit 6acaa31887
2 changed files with 24 additions and 0 deletions

View File

@ -1,3 +1,7 @@
Thu Jul 9 00:38:51 1998 Jeffrey A Law (law@cygnus.com)
* gcc.dg/980709-1.c: New test.
Tue Jul 7 13:41:27 1998 Richard Henderson <rth@cygnus.com>
* gcc.c-torture/execute/bcp-1.c: New test.

View File

@ -0,0 +1,20 @@
/* { dg-do compile { target i?86-*-* } } */
/* { dg-options -O2 } */
extern __inline__ int test_and_set_bit(int nr, volatile void * addr)
{
int oldbit;
__asm__ __volatile__( ""
"btsl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" (addr)
:"ir" (nr));
return oldbit;
}
struct buffer_head {
unsigned long b_state;
};
extern void lock_buffer(struct buffer_head * bh)
{
while (test_and_set_bit(2 , &bh->b_state))
__wait_on_buffer(bh);
}