brintos

brintos / llvm-project-archived public Read only

0
0
Text · 12.5 KiB · 2b3f7ed Raw
249 lines · plain
1; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s2; RUN: llc < %s | llvm-mc -filetype=obj --triple=x86_64-windows | llvm-readobj - --codeview | FileCheck %s3; RUN: llc < %s | FileCheck %s --check-prefix=ASM4 5; C++ source to regenerate:6; $ cat numeric-leaves.cpp7; const long long Minus1 = -1;8; const long long Minus128 = -128;9; const long long Minus129 = -129;10; const long long Minus32768 = -32768;11; const long long Minus32769 = -32769;12; const long long Minus2147483648 = -2147483648;13; const long long Minus2147483649 = -2147483649;14;15; const long long Zero = 0;16; const long long Plus32767 = 32767;17; const long long Plus32768 = 32768;18; const long long Plus2147483647 = 2147483647;19; const long long Plus2147483648 = 2147483648;20;21; int main(){22;   long long iDebug1 = Minus1 + Minus128 + Minus129 +23;                       Minus32768 + Minus32769 +24;                       Minus2147483648 + Minus2147483649;25;   long long iDebug2 = Zero + Plus32767 + Plus32768 +26;                       Plus2147483647 + Plus2147483648;27;28;   return 0;29;}30;31; $ clang numeric-leaves.cpp -S -emit-llvm -g -gcodeview -o nl.ll32 33; CHECK:         ConstantSym {34; CHECK-NEXT:      Kind: S_CONSTANT (0x1107)35; CHECK-NEXT:      Type: const __int64 (0x1003)36; CHECK-NEXT:      Value: -137; CHECK-NEXT:      Name: Minus138; CHECK-NEXT:    }39; CHECK:         ConstantSym {40; CHECK-NEXT:      Kind: S_CONSTANT (0x1107)41; CHECK-NEXT:      Type: const __int64 (0x1003)42; CHECK-NEXT:      Value: -12843; CHECK-NEXT:      Name: Minus12844; CHECK-NEXT:    }45; CHECK:         ConstantSym {46; CHECK-NEXT:      Kind: S_CONSTANT (0x1107)47; CHECK-NEXT:      Type: const __int64 (0x1003)48; CHECK-NEXT:      Value: -12949; CHECK-NEXT:      Name: Minus12950; CHECK-NEXT:    }51; CHECK:         ConstantSym {52; CHECK-NEXT:      Kind: S_CONSTANT (0x1107)53; CHECK-NEXT:      Type: const __int64 (0x1003)54; CHECK-NEXT:      Value: -3276855; CHECK-NEXT:      Name: Minus3276856; CHECK-NEXT:    }57; CHECK:         ConstantSym {58; CHECK-NEXT:      Kind: S_CONSTANT (0x1107)59; CHECK-NEXT:      Type: const __int64 (0x1003)60; CHECK-NEXT:      Value: -3276961; CHECK-NEXT:      Name: Minus3276962; CHECK-NEXT:    }63; CHECK:         ConstantSym {64; CHECK-NEXT:      Kind: S_CONSTANT (0x1107)65; CHECK-NEXT:      Type: const __int64 (0x1003)66; CHECK-NEXT:      Value: -214748364867; CHECK-NEXT:      Name: Minus214748364868; CHECK-NEXT:    }69; CHECK:         ConstantSym {70; CHECK-NEXT:      Kind: S_CONSTANT (0x1107)71; CHECK-NEXT:      Type: const __int64 (0x1003)72; CHECK-NEXT:      Value: -214748364973; CHECK-NEXT:      Name: Minus214748364974; CHECK-NEXT:    }75; CHECK:         ConstantSym {76; CHECK-NEXT:      Kind: S_CONSTANT (0x1107)77; CHECK-NEXT:      Type: const __int64 (0x1003)78; CHECK-NEXT:      Value: 079; CHECK-NEXT:      Name: Zero80; CHECK-NEXT:    }81; CHECK:         ConstantSym {82; CHECK-NEXT:      Kind: S_CONSTANT (0x1107)83; CHECK-NEXT:      Type: const __int64 (0x1003)84; CHECK-NEXT:      Value: 3276785; CHECK-NEXT:      Name: Plus3276786; CHECK-NEXT:    }87; CHECK:         ConstantSym {88; CHECK-NEXT:      Kind: S_CONSTANT (0x1107)89; CHECK-NEXT:      Type: const __int64 (0x1003)90; CHECK-NEXT:      Value: 3276891; CHECK-NEXT:      Name: Plus3276892; CHECK-NEXT:    }93; CHECK:         ConstantSym {94; CHECK-NEXT:      Kind: S_CONSTANT (0x1107)95; CHECK-NEXT:      Type: const __int64 (0x1003)96; CHECK-NEXT:      Value: 214748364797; CHECK-NEXT:      Name: Plus214748364798; CHECK-NEXT:    }99; CHECK:         ConstantSym {100; CHECK-NEXT:      Kind: S_CONSTANT (0x1107)101; CHECK-NEXT:      Type: const __int64 (0x1003)102; CHECK-NEXT:      Value: 2147483648103; CHECK-NEXT:      Name: Plus2147483648104 105; ASM-LABEL:    long     241                       # Symbol subsection for globals106 107; ASM:          .short   4359                      # Record kind: S_CONSTANT108; ASM-NEXT:     .long    4099                      # Type109; ASM-NEXT:     .byte    0x00, 0x80, 0xff          # Value110; ASM-NEXT:     .asciz   "Minus1"                  # Name111 112; ASM:          .short   4359                      # Record kind: S_CONSTANT113; ASM-NEXT:     .long    4099                      # Type114; ASM-NEXT:     .byte    0x00, 0x80, 0x80          # Value115; ASM-NEXT:     .asciz   "Minus128"                # Name116 117; ASM:          .short   4359                      # Record kind: S_CONSTANT118; ASM-NEXT:     .long    4099                      # Type119; ASM-NEXT:     .byte    0x01, 0x80, 0x7f, 0xff    # Value120; ASM-NEXT:     .asciz   "Minus129"                # Name121 122; ASM:          .short   4359                      # Record kind: S_CONSTANT123; ASM-NEXT:     .long    4099                      # Type124; ASM-NEXT:     .byte    0x01, 0x80, 0x00, 0x80    # Value125; ASM-NEXT:     .asciz   "Minus32768"              # Name126 127; ASM:          .short   4359                      # Record kind: S_CONSTANT128; ASM-NEXT:     .long    4099                      # Type129; ASM-NEXT:     .byte    0x03, 0x80, 0xff, 0x7f    # Value130; ASM-NEXT:     .byte    0xff, 0xff131; ASM-NEXT:     .asciz   "Minus32769"              # Name132 133; ASM:          .short   4359                      # Record kind: S_CONSTANT134; ASM-NEXT:     .long    4099                      # Type135; ASM-NEXT:     .byte    0x03, 0x80, 0x00, 0x00    # Value136; ASM-NEXT:     .byte    0x00, 0x80137; ASM-NEXT:     .asciz   "Minus2147483648"         # Name138 139; ASM:          .short   4359                      # Record kind: S_CONSTANT140; ASM-NEXT:     .long    4099                      # Type141; ASM-NEXT:     .byte    0x09, 0x80, 0xff, 0xff    # Value142; ASM-NEXT:     .byte    0xff, 0x7f, 0xff, 0xff143; ASM-NEXT:     .byte    0xff, 0xff144; ASM-NEXT:     .asciz   "Minus2147483649"         # Name145 146; ASM:          .short   4359                      # Record kind: S_CONSTANT147; ASM-NEXT:     .long    4099                      # Type148; ASM-NEXT:     .byte    0x00, 0x00                # Value149; ASM-NEXT:     .asciz   "Zero"                    # Name150 151; ASM:          .short   4359                      # Record kind: S_CONSTANT152; ASM-NEXT:     .long    4099                      # Type153; ASM-NEXT:     .byte    0xff, 0x7f                # Value154; ASM-NEXT:     .asciz   "Plus32767"               # Name155 156; ASM:          .short   4359                      # Record kind: S_CONSTANT157; ASM-NEXT:     .long    4099                      # Type158; ASM-NEXT:     .byte    0x03, 0x80, 0x00, 0x80    # Value159; ASM-NEXT:     .byte    0x00, 0x00160; ASM-NEXT:     .asciz   "Plus32768"               # Name161 162; ASM:          .short   4359                      # Record kind: S_CONSTANT163; ASM-NEXT:     .long    4099                      # Type164; ASM-NEXT:     .byte    0x03, 0x80, 0xff, 0xff    # Value165; ASM-NEXT:     .byte    0xff, 0x7f166; ASM-NEXT:     .asciz   "Plus2147483647"          # Name167 168; ASM:          .short   4359                      # Record kind: S_CONSTANT169; ASM-NEXT:     .long    4099                      # Type170; ASM-NEXT:     .byte    0x09, 0x80, 0x00, 0x00    # Value171; ASM-NEXT:     .byte    0x00, 0x80, 0x00, 0x00172; ASM-NEXT:     .byte    0x00, 0x00173; ASM-NEXT:     .asciz   "Plus2147483648"          # Name174 175; ModuleID = 'numeric-leaves.cpp'176source_filename = "numeric-leaves.cpp"177target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"178target triple = "x86_64-pc-windows-msvc19.29.30133"179 180; Function Attrs: mustprogress noinline norecurse nounwind optnone uwtable181define dso_local noundef i32 @main() #0 !dbg !35 {182entry:183  %retval = alloca i32, align 4184  %iDebug1 = alloca i64, align 8185  %iDebug2 = alloca i64, align 8186  store i32 0, ptr %retval, align 4187  call void @llvm.dbg.declare(metadata ptr %iDebug1, metadata !40, metadata !DIExpression()), !dbg !41188  store i64 -4295033092, ptr %iDebug1, align 8, !dbg !41189  call void @llvm.dbg.declare(metadata ptr %iDebug2, metadata !42, metadata !DIExpression()), !dbg !43190  store i64 4295032830, ptr %iDebug2, align 8, !dbg !43191  ret i32 0, !dbg !44192}193 194; Function Attrs: nofree nosync nounwind readnone speculatable willreturn195declare void @llvm.dbg.declare(metadata, metadata, metadata) #1196 197attributes #0 = { mustprogress noinline norecurse nounwind optnone uwtable "frame-pointer"="none" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }198attributes #1 = { nofree nosync nounwind readnone speculatable willreturn }199 200!llvm.dbg.cu = !{!0}201!llvm.module.flags = !{!29, !30, !31, !32, !33}202!llvm.ident = !{!34}203 204!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 15.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !2, splitDebugInlining: false, nameTableKind: None)205!1 = !DIFile(filename: "numeric-leaves.cpp", directory: "d:\\tmp", checksumkind: CSK_MD5, checksum: "9b1d86040d3b979a9b2b3e86c7bea0b4")206!2 = !{!3, !7, !9, !11, !13, !15, !17, !19, !21, !23, !25, !27}207!3 = !DIGlobalVariableExpression(var: !4, expr: !DIExpression(DW_OP_constu, 18446744073709551615, DW_OP_stack_value))208!4 = distinct !DIGlobalVariable(name: "Minus1", scope: !0, file: !1, line: 1, type: !5, isLocal: true, isDefinition: true)209!5 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !6)210!6 = !DIBasicType(name: "long long", size: 64, encoding: DW_ATE_signed)211!7 = !DIGlobalVariableExpression(var: !8, expr: !DIExpression(DW_OP_constu, 18446744073709551488, DW_OP_stack_value))212!8 = distinct !DIGlobalVariable(name: "Minus128", scope: !0, file: !1, line: 2, type: !5, isLocal: true, isDefinition: true)213!9 = !DIGlobalVariableExpression(var: !10, expr: !DIExpression(DW_OP_constu, 18446744073709551487, DW_OP_stack_value))214!10 = distinct !DIGlobalVariable(name: "Minus129", scope: !0, file: !1, line: 3, type: !5, isLocal: true, isDefinition: true)215!11 = !DIGlobalVariableExpression(var: !12, expr: !DIExpression(DW_OP_constu, 18446744073709518848, DW_OP_stack_value))216!12 = distinct !DIGlobalVariable(name: "Minus32768", scope: !0, file: !1, line: 4, type: !5, isLocal: true, isDefinition: true)217!13 = !DIGlobalVariableExpression(var: !14, expr: !DIExpression(DW_OP_constu, 18446744073709518847, DW_OP_stack_value))218!14 = distinct !DIGlobalVariable(name: "Minus32769", scope: !0, file: !1, line: 5, type: !5, isLocal: true, isDefinition: true)219!15 = !DIGlobalVariableExpression(var: !16, expr: !DIExpression(DW_OP_constu, 18446744071562067968, DW_OP_stack_value))220!16 = distinct !DIGlobalVariable(name: "Minus2147483648", scope: !0, file: !1, line: 6, type: !5, isLocal: true, isDefinition: true)221!17 = !DIGlobalVariableExpression(var: !18, expr: !DIExpression(DW_OP_constu, 18446744071562067967, DW_OP_stack_value))222!18 = distinct !DIGlobalVariable(name: "Minus2147483649", scope: !0, file: !1, line: 7, type: !5, isLocal: true, isDefinition: true)223!19 = !DIGlobalVariableExpression(var: !20, expr: !DIExpression(DW_OP_constu, 0, DW_OP_stack_value))224!20 = distinct !DIGlobalVariable(name: "Zero", scope: !0, file: !1, line: 9, type: !5, isLocal: true, isDefinition: true)225!21 = !DIGlobalVariableExpression(var: !22, expr: !DIExpression(DW_OP_constu, 32767, DW_OP_stack_value))226!22 = distinct !DIGlobalVariable(name: "Plus32767", scope: !0, file: !1, line: 10, type: !5, isLocal: true, isDefinition: true)227!23 = !DIGlobalVariableExpression(var: !24, expr: !DIExpression(DW_OP_constu, 32768, DW_OP_stack_value))228!24 = distinct !DIGlobalVariable(name: "Plus32768", scope: !0, file: !1, line: 11, type: !5, isLocal: true, isDefinition: true)229!25 = !DIGlobalVariableExpression(var: !26, expr: !DIExpression(DW_OP_constu, 2147483647, DW_OP_stack_value))230!26 = distinct !DIGlobalVariable(name: "Plus2147483647", scope: !0, file: !1, line: 12, type: !5, isLocal: true, isDefinition: true)231!27 = !DIGlobalVariableExpression(var: !28, expr: !DIExpression(DW_OP_constu, 2147483648, DW_OP_stack_value))232!28 = distinct !DIGlobalVariable(name: "Plus2147483648", scope: !0, file: !1, line: 13, type: !5, isLocal: true, isDefinition: true)233!29 = !{i32 2, !"CodeView", i32 1}234!30 = !{i32 2, !"Debug Info Version", i32 3}235!31 = !{i32 1, !"wchar_size", i32 2}236!32 = !{i32 7, !"PIC Level", i32 2}237!33 = !{i32 7, !"uwtable", i32 2}238!34 = !{!"clang version 15.0.0"}239!35 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 15, type: !36, scopeLine: 15, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !39)240!36 = !DISubroutineType(types: !37)241!37 = !{!38}242!38 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)243!39 = !{}244!40 = !DILocalVariable(name: "iDebug1", scope: !35, file: !1, line: 16, type: !6)245!41 = !DILocation(line: 16, scope: !35)246!42 = !DILocalVariable(name: "iDebug2", scope: !35, file: !1, line: 19, type: !6)247!43 = !DILocation(line: 19, scope: !35)248!44 = !DILocation(line: 22, scope: !35)249