0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include <errno.h>
0012 #include <inttypes.h>
0013 #include <pthread.h>
0014 #include <stdio.h>
0015 #include <stdlib.h>
0016 #include <unistd.h>
0017
0018 #include "utils.h"
0019 #include "tm.h"
0020
0021 int test_fork(void)
0022 {
0023 SKIP_IF(!have_htm());
0024 SKIP_IF(htm_is_synthetic());
0025
0026 asm __volatile__(
0027 "tbegin.;"
0028 "blt 1f; "
0029 "li 0, 2;"
0030 "sc ;"
0031 "tend.;"
0032 "1: ;"
0033 : : : "memory", "r0");
0034
0035
0036
0037 return 0;
0038 }
0039
0040 int main(int argc, char *argv[])
0041 {
0042 return test_harness(test_fork, "tm_fork");
0043 }