| Evgeniy Stepanov | 716f0ff22 | 2017-04-27 20:27:23 +0000 | [diff] [blame] | 1 | ; A module with no asan-instrumented globals has no asan destructor, and has an asan constructor in a comdat. |
| Evgeniy Stepanov | 964f466 | 2017-04-27 20:27:27 +0000 | [diff] [blame] | 2 | ; RUN: opt -mtriple=x86_64-unknown-linux-gnu < %s -asan -asan-module -asan-with-comdat=1 -asan-globals-live-support=1 -S | FileCheck %s |
| Evgeniy Stepanov | 716f0ff22 | 2017-04-27 20:27:23 +0000 | [diff] [blame] | 3 | |
| 4 | define void @f() { |
| 5 | ret void |
| 6 | } |
| 7 | |
| 8 | ; CHECK-NOT: @llvm.global_dtors |
| 9 | ; CHECK: @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 1, void ()* @asan.module_ctor, i8* bitcast (void ()* @asan.module_ctor to i8*) }] |
| 10 | ; CHECK-NOT: @llvm.global_dtors |
| 11 | ; CHECK: define internal void @asan.module_ctor() comdat |
| 12 | ; CHECK-NOT: @llvm.global_dtors |