1 /* { dg-do compile } */
2 /* { dg-options "-fgnu-tm" } */
4 void ts(void) __attribute__((transaction_safe
));
5 void tp(void) __attribute__((transaction_pure
));
6 void tc(void) __attribute__((transaction_callable
));
7 void ti(void) __attribute__((transaction_unsafe
));
8 void tm(void) __attribute__((transaction_may_cancel_outer
));
10 int fc(int) __attribute__((const));
12 typedef void (*Fs
) (void) __attribute__((transaction_safe
));
13 typedef void (*Fc
) (void) __attribute__((transaction_callable
));
14 typedef void (*Fi
) (void) __attribute__((transaction_unsafe
));
15 typedef void (*Fm
) (void) __attribute__((transaction_may_cancel_outer
));
20 extern void (*pu
)(void);
22 int __attribute__((transaction_safe
))
29 tc(); /* { dg-error "unsafe function call" } */
30 ti(); /* { dg-error "unsafe function call" } */
32 /* ??? Direct function calls without markups are handled later
33 than pass_diagnose_tm_blocks, which means we'll exit with
34 errors before getting there. This test moved to safe-3.c. */
38 (*pc
)(); /* { dg-error "unsafe function call" } */
39 (*pi
)(); /* { dg-error "unsafe function call" } */
40 (*pu
)(); /* { dg-error "unsafe function call" } */
42 asm(""); /* { dg-error "asm not allowed" } */
43 asm("" : "=g"(i
)); /* { dg-error "asm not allowed" } */
48 int __attribute__((transaction_may_cancel_outer
))
55 tc(); /* { dg-error "unsafe function call" } */
56 ti(); /* { dg-error "unsafe function call" } */
60 (*pc
)(); /* { dg-error "unsafe function call" } */
61 (*pi
)(); /* { dg-error "unsafe function call" } */
63 (*pu
)(); /* { dg-error "unsafe function call" } */
65 asm(""); /* { dg-error "asm not allowed" } */
66 asm("" : "=g"(i
)); /* { dg-error "asm not allowed" } */