aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CodeGen/tbaa-struct-relaxed-aliasing-with-tsan.cpp
blob: ce613b9d6b23f8016a97bb43c3425badf11b2ec7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// 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.

// 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;
}