brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.6 KiB · 7ace54b Raw
58 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature2; RUN: opt < %s -S -passes=ipsccp | FileCheck %s3;; Check that @patatino is optimised to "unreachable" given that it branches on4;; undef. Check too that debug intrinsics have no effect on this.5 6define void @main() {7; CHECK-LABEL: define {{[^@]+}}@main() {8; CHECK-NEXT:    [[CALL:%.*]] = call i1 @patatino(i1 undef)9; CHECK-NEXT:    ret void10;11  %call = call i1 @patatino(i1 undef)12  ret void13}14 15define internal i1 @patatino(i1 %a) {16; CHECK-LABEL: define {{[^@]+}}@patatino17; CHECK-SAME: (i1 [[A:%.*]]) {18; CHECK-NEXT:    unreachable19;20  br i1 %a, label %ontrue, label %onfalse21ontrue:22  call void @llvm.dbg.value(metadata i32 0, metadata !6, metadata !DIExpression()), !dbg !1123  call void @llvm.dbg.value(metadata i32 1, metadata !9, metadata !DIExpression()), !dbg !1124  ret i1 false25onfalse:26  call void @llvm.dbg.value(metadata i32 0, metadata !6, metadata !DIExpression()), !dbg !1127  call void @llvm.dbg.value(metadata i32 1, metadata !9, metadata !DIExpression()), !dbg !1128  ret i1 false29}30 31declare void @llvm.dbg.value(metadata, metadata, metadata) nounwind readnone32 33!llvm.module.flags = !{!21}34!llvm.dbg.cu = !{!2}35 36!0 = distinct !DISubprogram(name: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !2, file: !20, scope: !1, type: !3)37!1 = !DIFile(filename: "b.c", directory: "/private/tmp")38!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang", isOptimized: true, emissionKind: FullDebug, file: !20)39!3 = !DISubroutineType(types: !4)40!4 = !{!5}41!5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)42!6 = !DILocalVariable(name: "i", line: 2, arg: 1, scope: !0, file: !1, type: !5)43!7 = !DILocation(line: 2, column: 13, scope: !0)44!9 = !DILocalVariable(name: "k", line: 3, scope: !10, file: !1, type: !5)45!10 = distinct !DILexicalBlock(line: 2, column: 16, file: !20, scope: !0)46!11 = !DILocation(line: 3, column: 12, scope: !10)47!12 = !DILocation(line: 4, column: 3, scope: !10)48!13 = !DILocation(line: 5, column: 5, scope: !14)49!14 = distinct !DILexicalBlock(line: 4, column: 10, file: !20, scope: !10)50!15 = !DILocation(line: 6, column: 3, scope: !14)51!16 = !DILocation(line: 7, column: 5, scope: !17)52!17 = distinct !DILexicalBlock(line: 6, column: 10, file: !20, scope: !10)53!18 = !DILocation(line: 8, column: 3, scope: !17)54!19 = !DILocation(line: 9, column: 3, scope: !10)55!20 = !DIFile(filename: "b.c", directory: "/private/tmp")56!21 = !{i32 1, !"Debug Info Version", i32 3}57 58