OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [c-c++-common/] [tm/] [safe-3.c] - Blame information for rev 698

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

Line No. Rev Author Line
1 686 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-fgnu-tm" } */
3
 
4
void f_extern (void);
5
void f_first (void);
6
void f_later (void);
7
 
8
extern int x;
9
 
10
void f_first (void) { x++; }
11
 
12
void __attribute__((transaction_safe))
13
test_safe (void)
14
{
15
  f_extern ();          /* { dg-error "unsafe function call" } */
16
  f_first ();
17
  f_later ();
18
}
19
 
20
void __attribute__((transaction_may_cancel_outer))
21
test_mco (void)
22
{
23
  f_extern ();          /* { dg-error "unsafe function call" } */
24
  f_first ();
25
  f_later ();
26
}
27
 
28
void
29
test_atomic (void)
30
{
31
  __transaction_atomic {
32
    f_extern ();        /* { dg-error "unsafe function call" } */
33
    f_first ();
34
    f_later ();
35
  }
36
  __transaction_relaxed {
37
    f_extern ();
38
    f_first ();
39
    f_later ();
40
  }
41
  __transaction_atomic [[outer]] {
42
    f_extern ();        /* { dg-error "unsafe function call" } */
43
    f_first ();
44
    f_later ();
45
  }
46
}
47
 
48
void f_later () { f_first(); test_safe(); }

powered by: WebSVN 2.1.0

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