1 // Test that rolling back allocations works.
2 #include <stdlib.h>
3 
dont_optimize(void * p)4 void __attribute((transaction_pure,noinline)) dont_optimize(void* p)
5 {
6   *(volatile char *) p;
7 }
8 
main()9 int main()
10 {
11   __transaction_atomic {
12     void *p = malloc (23);
13     dont_optimize (p);
14     __transaction_cancel;
15   }
16   return 0;
17 }
18