[PATCH] D17802: [TSAN] Fix test java_race_pc for MIPS
Sagar Thakur via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 2 03:45:17 PST 2016
sagar created this revision.
sagar added reviewers: samsonov, dvyukov.
sagar added subscribers: jaydeep, mohit.bhakkad, llvm-commits.
sagar set the repository for this revision to rL LLVM.
For mips we reduce pc by 8 in function StackTrace::GetPreviousInstructionPc. Therefore we need to increase pc by 8 here to get the correct address in the stacktrace.
Repository:
rL LLVM
http://reviews.llvm.org/D17802
Files:
test/tsan/java_race_pc.cc
Index: test/tsan/java_race_pc.cc
===================================================================
--- test/tsan/java_race_pc.cc
+++ test/tsan/java_race_pc.cc
@@ -13,7 +13,11 @@
void *Thread(void *p) {
barrier_wait(&barrier);
+#if defined(__mips__)
+ __tsan_read1_pc((jptr)p, (jptr)foobar + 8);
+#else
__tsan_read1_pc((jptr)p, (jptr)foobar + 1);
+#endif
return 0;
}
@@ -26,7 +30,11 @@
__tsan_java_alloc(jheap, kBlockSize);
pthread_t th;
pthread_create(&th, 0, Thread, (void*)jheap);
+#if defined(__mips__)
+ __tsan_write1_pc((jptr)jheap, (jptr)barbaz + 8);
+#else
__tsan_write1_pc((jptr)jheap, (jptr)barbaz + 1);
+#endif
barrier_wait(&barrier);
pthread_join(th, 0);
__tsan_java_free(jheap, kBlockSize);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17802.49599.patch
Type: text/x-patch
Size: 743 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160302/cf20cbf9/attachment.bin>
More information about the llvm-commits
mailing list