1; REQUIRES: asserts 2; RUN: llc < %s -O1 -mtriple=x86_64-unknown-unknown -o /dev/null -debug-only=selectiondag 2>&1 | FileCheck %s 3 4target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" 5target triple = "x86_64-apple-macosx10.13.0" 6 7define i32 @main(i32 %argc, ptr %argv) !dbg !8 { 8entry: 9 %retval = alloca i32, align 4 10 %argc.addr = alloca i32, align 4 11 %argv.addr = alloca ptr, align 8 12 store i32 0, ptr %retval, align 4 13 store i32 %argc, ptr %argc.addr, align 4 14 call void @llvm.dbg.declare(metadata ptr %argc.addr, metadata !16, metadata !DIExpression()), !dbg !17 15 store ptr %argv, ptr %argv.addr, align 8 16 call void @llvm.dbg.declare(metadata ptr %argv.addr, metadata !18, metadata !DIExpression()), !dbg !19 17 %0 = load ptr, ptr %argv.addr, align 8, !dbg !20 18 %1 = load i32, ptr %argc.addr, align 4, !dbg !21 19 %idxprom = sext i32 %1 to i64, !dbg !20 20 %arrayidx = getelementptr inbounds ptr, ptr %0, i64 %idxprom, !dbg !20 21 %2 = load ptr, ptr %arrayidx, align 8, !dbg !20 22 %3 = load i8, ptr %2, align 1, !dbg !20 23 %conv = sext i8 %3 to i32, !dbg !20 24 25 ; CHECK: X86ISD::RET_GLUE {{.*}}, TargetConstant:i32<0>, Register:i32 $eax, {{.*}}, <stdin>:2:3 26 ret i32 %conv, !dbg !22 27} 28 29declare void @llvm.dbg.declare(metadata, metadata, metadata) 30 31!llvm.dbg.cu = !{!0} 32!llvm.module.flags = !{!3, !4, !5, !6} 33!llvm.ident = !{!7} 34 35!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 7.0.0 (trunk 330296) (llvm/trunk 330298)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) 36!1 = !DIFile(filename: "-", directory: "/Users/vsk/src/builds/llvm.org-main-RA") 37!2 = !{} 38!3 = !{i32 2, !"Dwarf Version", i32 4} 39!4 = !{i32 2, !"Debug Info Version", i32 3} 40!5 = !{i32 1, !"wchar_size", i32 4} 41!6 = !{i32 7, !"PIC Level", i32 2} 42!7 = !{!"clang version 7.0.0 (trunk 330296) (llvm/trunk 330298)"} 43!8 = distinct !DISubprogram(name: "main", scope: !9, file: !9, line: 1, type: !10, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2) 44!9 = !DIFile(filename: "<stdin>", directory: "/Users/vsk/src/builds/llvm.org-main-RA") 45!10 = !DISubroutineType(types: !11) 46!11 = !{!12, !12, !13} 47!12 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) 48!13 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !14, size: 64) 49!14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !15, size: 64) 50!15 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char) 51!16 = !DILocalVariable(name: "argc", arg: 1, scope: !8, file: !9, line: 1, type: !12) 52!17 = !DILocation(line: 1, column: 14, scope: !8) 53!18 = !DILocalVariable(name: "argv", arg: 2, scope: !8, file: !9, line: 1, type: !13) 54!19 = !DILocation(line: 1, column: 27, scope: !8) 55!20 = !DILocation(line: 2, column: 10, scope: !8) 56!21 = !DILocation(line: 2, column: 15, scope: !8) 57!22 = !DILocation(line: 2, column: 3, scope: !8) 58