OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [ia64-sync-4.c] - Blame information for rev 645

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-do compile } */
2
/* { dg-require-effective-target sync_int_long } */
3
/* { dg-options "-O2 -finline-functions" } */
4
/* { dg-options "-march=i486" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
5
/* { dg-options "-mcpu=v9" { target sparc*-*-* } } */
6
 
7
/* Test inlining __sync_bool_compare_and_swap.  */
8
 
9
#include <stdbool.h>
10
 
11
static bool
12
compare_and_swap(long *addr, long old, long new_val)
13
{
14
  return __sync_bool_compare_and_swap(addr, old, new_val);
15
}
16
 
17
void
18
foo (long *address)
19
{
20
  long he_address = *address & ~1;
21
  while (!compare_and_swap(address, he_address, he_address | 1))
22
    he_address = *address & ~1;
23
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.