brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · e9dd944 Raw
38 lines · plain
1; RUN: opt -S -passes=globaldce < %s | FileCheck %s2 3; Test that the presence of debug intrinsics isn't affecting GlobalDCE.4; CHECK: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @_notremovable, ptr null }]5; CHECK-NOT: @_GLOBAL__I_a6 7declare void @_notremovable()8 9@llvm.global_ctors = appending global [3 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @_GLOBAL__I_a, ptr null }, { i32, ptr, ptr } { i32 65535, ptr @_GLOBAL__I_b, ptr null }, { i32, ptr, ptr } { i32 65535, ptr @_notremovable, ptr null }]10 11@x = internal unnamed_addr constant i8 undef, align 112 13; Function Attrs: nounwind readnone14define internal void @_GLOBAL__I_a() #1 section "__TEXT,__StaticInit,regular,pure_instructions" {15entry:16  ret void17}18 19; Function Attrs: nounwind readnone20define internal void @_GLOBAL__I_b() #1 section "__TEXT,__StaticInit,regular,pure_instructions" {21entry:22  tail call void @llvm.dbg.value(metadata ptr @x, metadata !4, metadata !DIExpression(DW_OP_deref, DW_OP_constu, 0, DW_OP_swap, DW_OP_xderef)), !dbg !523  ret void24}25 26; Function Attrs: nounwind readnone speculatable27declare void @llvm.dbg.value(metadata, metadata, metadata)28 29!llvm.module.flags = !{!0}30!llvm.dbg.cu = !{!1}31 32!0 = !{i32 2, !"Debug Info Version", i32 3}33!1 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, emissionKind: FullDebug)34!2 = !DIFile(filename: "filename", directory: "directory")35!3 = distinct !DISubprogram(name: "h1", unit: !1)36!4 = !DILocalVariable(name: "b", arg: 1, scope: !3)37!5 = !DILocation(scope: !3)38