diff options
Diffstat (limited to 'test/CodeGen/tbaa-thread-sanitizer.cpp')
-rw-r--r-- | test/CodeGen/tbaa-thread-sanitizer.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGen/tbaa-thread-sanitizer.cpp b/test/CodeGen/tbaa-thread-sanitizer.cpp new file mode 100644 index 0000000..abffae3 --- /dev/null +++ b/test/CodeGen/tbaa-thread-sanitizer.cpp @@ -0,0 +1,14 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o - %s -fsanitize=thread -relaxed-aliasing -O1 | FileCheck %s + +// Make sure we do not crash when relaxed-aliasing is on. +// CHECK-NOT: !tbaa +struct iterator { void *node; }; + +struct pair { + iterator first; + pair(const iterator &a) : first(a) {} +}; + +void equal_range() { + (void)pair(iterator()); +} |