llvm-mirror/test/Verifier/global-ctors.ll
Reid Kleckner fd1a7dfe04 Add comdat key field to llvm.global_ctors and llvm.global_dtors
This allows us to put dynamic initializers for weak data into the same
comdat group as the data being initialized.  This is necessary for MSVC
ABI compatibility.  Once we have comdats for guard variables, we can use
the combination to help GlobalOpt fire more often for weak data with
guarded initialization on other platforms.

Reviewers: nlewycky

Differential Revision: http://reviews.llvm.org/D3499

llvm-svn: 209015
2014-05-16 20:39:27 +00:00

12 lines
432 B
LLVM

; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
@llvm.global_ctors = appending global [1 x { i32, void()*, i8 } ] [
{ i32, void()*, i8 } { i32 65535, void ()* null, i8 0 }
]
; CHECK: wrong type for intrinsic global variable
@llvm.global_dtors = appending global [1 x { i32, void()*, i8*, i8 } ] [
{ i32, void()*, i8*, i8 } { i32 65535, void ()* null, i8* null, i8 0}
]
; CHECK: wrong type for intrinsic global variable