diff options
author | Stephen Hines <srhines@google.com> | 2015-03-23 12:10:34 -0700 |
---|---|---|
committer | Stephen Hines <srhines@google.com> | 2015-03-23 12:10:34 -0700 |
commit | ebe69fe11e48d322045d5949c83283927a0d790b (patch) | |
tree | c92f1907a6b8006628a4b01615f38264d29834ea /test/CodeGen/X86/init-priority.ll | |
parent | b7d2e72b02a4cb8034f32f8247a2558d2434e121 (diff) | |
download | external_llvm-ebe69fe11e48d322045d5949c83283927a0d790b.zip external_llvm-ebe69fe11e48d322045d5949c83283927a0d790b.tar.gz external_llvm-ebe69fe11e48d322045d5949c83283927a0d790b.tar.bz2 |
Update aosp/master LLVM for rebase to r230699.
Change-Id: I2b5be30509658cb8266be782de0ab24f9099f9b9
Diffstat (limited to 'test/CodeGen/X86/init-priority.ll')
-rw-r--r-- | test/CodeGen/X86/init-priority.ll | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/test/CodeGen/X86/init-priority.ll b/test/CodeGen/X86/init-priority.ll new file mode 100644 index 0000000..a0cff23 --- /dev/null +++ b/test/CodeGen/X86/init-priority.ll @@ -0,0 +1,51 @@ +; RUN: llc < %s -mtriple=x86_64-unknown-freebsd9 | FileCheck %s + +; Check that our compiler never emits global constructors +; inside the .init_array section when building for a non-Linux ELF target. +; Because of this, the test depends on UseInitArray behavior under FreeBSD +; as found in Generic_ELF::addClangTargetOptions(). + +; This is to workaround a Visual Studio bug which causes field +; UseInitArray to be left uninitialized instead of being +; zero-initialized (as specified in [dcl.init]p7). +; This workaround consists in providing a user default constructor +; that explicitly initializes field UseInitArray. + +%class.C = type { i8 } +%class.D = type { i8 } + +@c1 = global %class.C zeroinitializer, align 1 +@d1 = global %class.D zeroinitializer, align 1 +@llvm.global_ctors = appending global [2 x { i32, void ()* }] [{ i32, void ()* } { i32 101, void ()* @_GLOBAL__I_000101 }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }] + +define linkonce_odr void @_ZN1CC1Ev(%class.C* nocapture %this) { +entry: + ret void +} + +define linkonce_odr void @_ZN1DC1Ev(%class.D* nocapture %this) { +entry: + ret void +} + +define linkonce_odr void @_ZN1DC2Ev(%class.D* nocapture %this) { +entry: + ret void +} + +define linkonce_odr void @_ZN1CC2Ev(%class.C* nocapture %this) { +entry: + ret void +} + +define internal void @_GLOBAL__I_000101() nounwind readnone { +entry: + ret void +} + +define internal void @_GLOBAL__I_a() nounwind readnone { +entry: + ret void +} + +; CHECK-NOT: .init_array |