* c-c++-common/ubsan/float-cast-overflow-6.c: Add i?86-*-* target.
[official-gcc.git] / gcc / testsuite / gcc.dg / tm / 20100615.c
blob26964d43367cde92a03342cb1672768b7cb8bc1f
1 /* { dg-do compile } */
2 /* { dg-options "-fgnu-tm -O" } */
4 /* Since the non TM version of new_node() gets optimized away, it
5 shouldn't appear in the clone table either. */
6 /* { dg-final { scan-assembler-not "tm_clone_table" { target { ! *-*-darwin* } } } } */
7 /* { dg-final { scan-assembler-not "__DATA,__tm_clone_table" { target *-*-darwin* } } } */
9 #define NULL 0
10 extern void *malloc (__SIZE_TYPE__);
12 __attribute__((transaction_pure))
13 void exit(int status);
15 typedef struct node {
16 } node_t;
18 __attribute__((transaction_safe))
19 static node_t *new_node(node_t *next)
21 node_t *node;
22 node = (node_t *)malloc(sizeof(node_t));
23 if (node == NULL) {
24 exit(1);
26 return NULL;
29 static node_t *set_new()
31 node_t *min, *max;
32 __transaction_atomic {
33 max = new_node(NULL);
34 min = new_node(max);
36 return min;
39 int main(int argc, char **argv)
41 set_new();
42 return 0;