Skip to content

Commit 42853d0

Browse files
committed
[TBAA] Add test showing tbaa.struct being generated with relaxed-alias.
Add test showing that tbaa.struct is generated when using TSan with relaxed-aliasing. (cherry-picked from 167b90d)
1 parent 3cb8aeb commit 42853d0

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o - -O1 -relaxed-aliasing -fsanitize=thread -disable-llvm-optzns %s | \
2+
// RUN: FileCheck %s
3+
// RUN: %clang_cc1 -triple x86_64-apple-darwin -new-struct-path-tbaa \
4+
// RUN: -emit-llvm -o - -O1 -relaxed-aliasing -fsanitize=thread -disable-llvm-optzns %s | \
5+
// RUN: FileCheck %s
6+
//
7+
// Check that we do not create tbaa for instructions generated for copies.
8+
// FIXME: !tbaa.struct is generated with null node as tag.
9+
10+
// CHECK: !tbaa.struct
11+
// CHECK-NOT: !tbaa
12+
13+
struct A {
14+
short s;
15+
int i;
16+
char c;
17+
int j;
18+
};
19+
20+
void copyStruct(A *a1, A *a2) {
21+
*a1 = *a2;
22+
}
23+
24+
void copyInt(int *a, int *b) {
25+
*a = *b;
26+
}

0 commit comments

Comments
 (0)