diff options
author | Alexey Samsonov <samsonov@google.com> | 2013-04-05 07:47:28 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2013-04-05 07:47:28 +0000 |
commit | cb9efbe6d727d2eb8a62fd7df2a91055b037f11b (patch) | |
tree | f89b864218a0ff2c0d8e417615aad20eb8bb7f63 /clang/test/CodeGen/sanitize-init-order.cpp | |
parent | 46b8665ea49afebea3161dbad80f81b4d81fd83f (diff) | |
download | bcm5719-llvm-cb9efbe6d727d2eb8a62fd7df2a91055b037f11b.tar.gz bcm5719-llvm-cb9efbe6d727d2eb8a62fd7df2a91055b037f11b.zip |
Allow EmitConstantInit() to emit constant initializers for objects with trivial constructors and non-trivial destructors. Test that such objects are ignored by init-order checker.
llvm-svn: 178856
Diffstat (limited to 'clang/test/CodeGen/sanitize-init-order.cpp')
-rw-r--r-- | clang/test/CodeGen/sanitize-init-order.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/test/CodeGen/sanitize-init-order.cpp b/clang/test/CodeGen/sanitize-init-order.cpp new file mode 100644 index 00000000000..3e94620193f --- /dev/null +++ b/clang/test/CodeGen/sanitize-init-order.cpp @@ -0,0 +1,24 @@ +// RUN: %clang_cc1 -fsanitize=address,init-order -emit-llvm -o - %s | FileCheck %s + +struct PODStruct { + int x; +}; +PODStruct s1; + +struct PODWithDtor { + ~PODWithDtor() { } + int x; +}; +PODWithDtor s2; + +struct PODWithCtorAndDtor { + PODWithCtorAndDtor() { } + ~PODWithCtorAndDtor() { } + int x; +}; +PODWithCtorAndDtor s3; + +// Check that ASan init-order checking ignores structs with trivial default +// constructor. +// CHECK: !llvm.asan.dynamically_initialized_globals = !{[[GLOB:![0-9]+]]} +// CHECK: [[GLOB]] = metadata !{%struct.PODWithCtorAndDtor |