forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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.
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
clang/test/CodeGen/tbaa-struct-relaxed-aliasing-with-tsan.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o - -O1 -relaxed-aliasing -fsanitize=thread -disable-llvm-optzns %s | \ | ||
// RUN: FileCheck %s | ||
// RUN: %clang_cc1 -triple x86_64-apple-darwin -new-struct-path-tbaa \ | ||
// RUN: -emit-llvm -o - -O1 -relaxed-aliasing -fsanitize=thread -disable-llvm-optzns %s | \ | ||
// RUN: FileCheck %s | ||
// | ||
// Check that we do not create tbaa for instructions generated for copies. | ||
// FIXME: !tbaa.struct is generated with null node as tag. | ||
|
||
// CHECK: !tbaa.struct | ||
// CHECK-NOT: !tbaa | ||
|
||
struct A { | ||
short s; | ||
int i; | ||
char c; | ||
int j; | ||
}; | ||
|
||
void copyStruct(A *a1, A *a2) { | ||
*a1 = *a2; | ||
} | ||
|
||
void copyInt(int *a, int *b) { | ||
*a = *b; | ||
} |