brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.6 KiB · d6f45b1 Raw
119 lines · plain
1; RUN: llc < %s | FileCheck %s2; RUN: llc -mtriple=i686-windows-msvc < %s -filetype=obj | llvm-readobj --codeview - | FileCheck %s --check-prefix=OBJ3 4; C source:5; void usethings(ptr, ptr p);6; int realign_and_alloca(int n) {7;   double d = 0;8;   ptr p = __builtin_alloca(n);9;   usethings(&d, p);10;   return 0;11; }12 13; CHECK: _realign_and_alloca:                    # @realign_and_alloca14; CHECK:         .cv_fpo_proc    _realign_and_alloca 415; CHECK:         pushl   %ebp16; CHECK:         .cv_fpo_pushreg %ebp17; CHECK:         movl    %esp, %ebp18; CHECK:         .cv_fpo_setframe        %ebp19; CHECK:         pushl   %esi20; CHECK:         .cv_fpo_pushreg %esi21; CHECK:         andl    $-16, %esp22; CHECK:         .cv_fpo_stackalign      1623; CHECK:         subl    $32, %esp24; CHECK:         .cv_fpo_stackalloc      3225; CHECK:         .cv_fpo_endprologue26; CHECK:         movl    %esp, %esi27; CHECK:         leal    8(%esi),28; CHECK:         calll   _usethings29; CHECK:         addl    $8, %esp30; CHECK:         xorl    %eax, %eax31; CHECK:         leal    -4(%ebp), %esp32; CHECK:         popl    %esi33; CHECK:         popl    %ebp34; CHECK:         retl35; CHECK:         .cv_fpo_endproc36 37; OBJ-LABEL:     FunctionType: realign_and_alloca (0x1002)38; OBJ-NEXT:      CodeOffset: _realign_and_alloca+0x039; OBJ-NEXT:      Segment: 0x040; OBJ-NEXT:      Flags [ (0x81)41; OBJ-NEXT:        HasFP (0x1)42; OBJ-NEXT:        HasOptimizedDebugInfo (0x80)43; OBJ-NEXT:      ]44; OBJ-NEXT:      DisplayName: realign_and_alloca45; OBJ-NEXT:      LinkageName: _realign_and_alloca46 47; ModuleID = 't.c'48source_filename = "t.c"49target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"50target triple = "i386-pc-windows-msvc19.11.25508"51 52; Function Attrs: nounwind53define i32 @realign_and_alloca(i32 %n) local_unnamed_addr #0 !dbg !8 {54entry:55  %d = alloca double, align 856  tail call void @llvm.dbg.value(metadata i32 %n, metadata !13, metadata !DIExpression()), !dbg !1857  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #4, !dbg !1958  tail call void @llvm.dbg.value(metadata double 0.000000e+00, metadata !14, metadata !DIExpression()), !dbg !2059  store double 0.000000e+00, ptr %d, align 8, !dbg !20, !tbaa !2160  %0 = alloca i8, i32 %n, align 16, !dbg !2561  tail call void @llvm.dbg.value(metadata ptr %0, metadata !16, metadata !DIExpression()), !dbg !2662  tail call void @llvm.dbg.value(metadata ptr %d, metadata !14, metadata !DIExpression()), !dbg !2063  call void @usethings(ptr nonnull %d, ptr nonnull %0) #4, !dbg !2764  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #4, !dbg !2865  ret i32 0, !dbg !2966}67 68; Function Attrs: argmemonly nounwind69declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #170 71declare void @usethings(ptr, ptr) local_unnamed_addr #272 73; Function Attrs: argmemonly nounwind74declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #175 76; Function Attrs: nounwind readnone speculatable77declare void @llvm.dbg.value(metadata, metadata, metadata) #378 79attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="pentium4" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }80attributes #1 = { argmemonly nounwind }81attributes #2 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="pentium4" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }82attributes #3 = { nounwind readnone speculatable }83attributes #4 = { nounwind }84 85!llvm.dbg.cu = !{!0}86!llvm.module.flags = !{!3, !4, !5, !6}87!llvm.ident = !{!7}88 89!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 6.0.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)90!1 = !DIFile(filename: "t.c", directory: "C:\5Csrc\5Cllvm-project\5Cbuild", checksumkind: CSK_MD5, checksum: "cfdc2deff5dc50f95e287f877660d4dd")91!2 = !{}92!3 = !{i32 1, !"NumRegisterParameters", i32 0}93!4 = !{i32 2, !"CodeView", i32 1}94!5 = !{i32 2, !"Debug Info Version", i32 3}95!6 = !{i32 1, !"wchar_size", i32 2}96!7 = !{!"clang version 6.0.0 "}97!8 = distinct !DISubprogram(name: "realign_and_alloca", scope: !1, file: !1, line: 2, type: !9, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !12)98!9 = !DISubroutineType(types: !10)99!10 = !{!11, !11}100!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)101!12 = !{!13, !14, !16}102!13 = !DILocalVariable(name: "n", arg: 1, scope: !8, file: !1, line: 2, type: !11)103!14 = !DILocalVariable(name: "d", scope: !8, file: !1, line: 3, type: !15)104!15 = !DIBasicType(name: "double", size: 64, encoding: DW_ATE_float)105!16 = !DILocalVariable(name: "p", scope: !8, file: !1, line: 4, type: !17)106!17 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 32)107!18 = !DILocation(line: 2, column: 28, scope: !8)108!19 = !DILocation(line: 3, column: 3, scope: !8)109!20 = !DILocation(line: 3, column: 10, scope: !8)110!21 = !{!22, !22, i64 0}111!22 = !{!"double", !23, i64 0}112!23 = !{!"omnipotent char", !24, i64 0}113!24 = !{!"Simple C/C++ TBAA"}114!25 = !DILocation(line: 4, column: 13, scope: !8)115!26 = !DILocation(line: 4, column: 9, scope: !8)116!27 = !DILocation(line: 5, column: 3, scope: !8)117!28 = !DILocation(line: 7, column: 1, scope: !8)118!29 = !DILocation(line: 6, column: 3, scope: !8)119