mirror of
https://github.com/autc04/Retro68.git
synced 2024-12-13 03:29:50 +00:00
29 lines
442 B
C
29 lines
442 B
C
|
/* Verify that we can look up tm clone of transaction_callable
|
||
|
and transaction_pure. */
|
||
|
|
||
|
#include <stdlib.h>
|
||
|
#include <libitm.h>
|
||
|
|
||
|
static int x;
|
||
|
|
||
|
int __attribute__((transaction_pure)) pure(int i)
|
||
|
{
|
||
|
return i+2;
|
||
|
}
|
||
|
|
||
|
int __attribute__((transaction_callable)) callable(void)
|
||
|
{
|
||
|
return ++x;
|
||
|
}
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
if (_ITM_getTMCloneSafe (&pure) != &pure)
|
||
|
abort ();
|
||
|
|
||
|
if (_ITM_getTMCloneSafe (&callable) == NULL)
|
||
|
abort ();
|
||
|
|
||
|
return 0;
|
||
|
}
|