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.
10 lines
410 B
LLVM
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
|