Files
clang-p2996/llvm/test/Transforms/GlobalOpt/undef-ctor-dtor.ll
Nikita Popov 067c035012 [GlobalOpt] Handle undef global_ctors gracefully
If there are no ctors, then this can have an arbirary zero-sized
value. The current code checks for null, but it could also be
undef or poison.

Replacing the specific null check with a check for
non-ConstantArray.
2022-03-10 16:02:12 +01:00

10 lines
410 B
LLVM

; RUN: opt -S -globalopt < %s | FileCheck %s
; Gracefully handle undef global_ctors/global_dtors
; CHECK: @llvm.global_ctors = appending global [0 x { i32, void ()*, i8* }] undef
; CHECK: @llvm.global_dtors = appending global [0 x { i32, void ()*, i8* }] undef
@llvm.global_ctors = appending global [0 x { i32, void ()*, i8* }] undef
@llvm.global_dtors = appending global [0 x { i32, void ()*, i8* }] undef