forked from OSchip/llvm-project
[tsan] Fix stack_sync_reuse.cc test on OS X
The test relies on two variables in different frames to end up being on the same address. For some reason, this isn't true on OS X. This patch adds `__attribute__((aligned(64)))` to the variables, which actually makes the variables occupy the same address. This is still not a guarantee, but it's more likely to work (the test looks very fragile already). Differential Revision: http://reviews.llvm.org/D14925 llvm-svn: 253981
This commit is contained in:
parent
941d0a756a
commit
6cb7f7a923
|
@ -31,7 +31,8 @@ void *Thread(void *x) {
|
|||
}
|
||||
|
||||
void __attribute__((noinline)) foobar() {
|
||||
long s;
|
||||
__attribute__((aligned(64))) long s;
|
||||
|
||||
addr = &s;
|
||||
__atomic_store_n(&s, 0, __ATOMIC_RELAXED);
|
||||
__atomic_store_n(&syncp, &s, __ATOMIC_RELEASE);
|
||||
|
@ -40,7 +41,8 @@ void __attribute__((noinline)) foobar() {
|
|||
}
|
||||
|
||||
void __attribute__((noinline)) barfoo() {
|
||||
long s;
|
||||
__attribute__((aligned(64))) long s;
|
||||
|
||||
if (addr != &s) {
|
||||
printf("address mismatch addr=%p &s=%p\n", addr, &s);
|
||||
exit(1);
|
||||
|
|
Loading…
Reference in New Issue