1f84c70a3SMatheus Izvekov; RUN: llc < %s | FileCheck %s --check-prefix=ASM 2f84c70a3SMatheus Izvekov 3f84c70a3SMatheus Izvekov; // C++ source to regenerate: 4f84c70a3SMatheus Izvekov; enum class uns : __uint128_t { unsval = __uint128_t(1) << 64 }; 5f84c70a3SMatheus Izvekov; uns t1() { return uns::unsval; } 6f84c70a3SMatheus Izvekov; enum class sig : __int128 { sigval = -(__int128(1) << 64) }; 7f84c70a3SMatheus Izvekov; sig t2() { return sig::sigval; } 8f84c70a3SMatheus Izvekov; struct test { 9f84c70a3SMatheus Izvekov; static const __uint128_t u128 = __uint128_t(1) << 64; 10f84c70a3SMatheus Izvekov; static const __int128 s128 = -(__int128(1) << 64); 11f84c70a3SMatheus Izvekov; }; 12f84c70a3SMatheus Izvekov; test t3() { return test(); } 13f84c70a3SMatheus Izvekov; 14f84c70a3SMatheus Izvekov; $ clang a.cpp -S -emit-llvm -g -gcodeview 15f84c70a3SMatheus Izvekov 16f84c70a3SMatheus Izvekov; ------------------------------------------------------------------------------ 17f84c70a3SMatheus Izvekov 18f84c70a3SMatheus Izvekov; ASM-LABEL: .long 241 # Symbol subsection for globals 19f84c70a3SMatheus Izvekov; 20f84c70a3SMatheus Izvekov; ASM-LABEL: .short 4359 # Record kind: S_CONSTANT 21f84c70a3SMatheus Izvekov; ASM-NEXT: .long 4110 # Type 22f84c70a3SMatheus Izvekov; ASM-NEXT: .byte 0x0a, 0x80, 0xff, 0xff # Value 23f84c70a3SMatheus Izvekov; ASM-NEXT: .byte 0xff, 0xff, 0xff, 0xff 24f84c70a3SMatheus Izvekov; ASM-NEXT: .byte 0xff, 0xff 25f84c70a3SMatheus Izvekov; ASM-NEXT: .asciz "test::u128" # Name 26f84c70a3SMatheus Izvekov; ASM-NEXT: .p2align 2 27f84c70a3SMatheus Izvekov; 28f84c70a3SMatheus Izvekov; ASM-LABEL: .short 4359 # Record kind: S_CONSTANT 29f84c70a3SMatheus Izvekov; ASM-NEXT: .long 4111 # Type 30f84c70a3SMatheus Izvekov; ASM-NEXT: .byte 0x09, 0x80, 0x00, 0x00 # Value 31f84c70a3SMatheus Izvekov; ASM-NEXT: .byte 0x00, 0x00, 0x00, 0x00 32f84c70a3SMatheus Izvekov; ASM-NEXT: .byte 0x00, 0x80 33f84c70a3SMatheus Izvekov; ASM-NEXT: .asciz "test::s128" # Name 34f84c70a3SMatheus Izvekov; ASM-NEXT: .p2align 2 35f84c70a3SMatheus Izvekov; 36f84c70a3SMatheus Izvekov; ASM-LABEL: .short 0x1203 # Record kind: LF_FIELDLIST 37f84c70a3SMatheus Izvekov; ASM-NEXT: .short 0x1502 # Member kind: Enumerator ( LF_ENUMERATE ) 38f84c70a3SMatheus Izvekov; ASM-NEXT: .short 0x3 # Attrs: Public 39f84c70a3SMatheus Izvekov; ASM-NEXT: .short 0x800a 40f84c70a3SMatheus Izvekov; ASM-NEXT: .quad 0xffffffffffffffff # EnumValue 41f84c70a3SMatheus Izvekov; ASM-NEXT: .asciz "unsval" # Name 42f84c70a3SMatheus Izvekov; 43f84c70a3SMatheus Izvekov; ASM-LABEL: .short 0x1203 # Record kind: LF_FIELDLIST 44f84c70a3SMatheus Izvekov; ASM-NEXT: .short 0x1502 # Member kind: Enumerator ( LF_ENUMERATE ) 45f84c70a3SMatheus Izvekov; ASM-NEXT: .short 0x3 # Attrs: Public 46f84c70a3SMatheus Izvekov; ASM-NEXT: .short 0x800a 47f84c70a3SMatheus Izvekov; ASM-NEXT: .quad 0xffffffffffffffff # EnumValue 48f84c70a3SMatheus Izvekov; ASM-NEXT: .asciz "sigval" # Name 49f84c70a3SMatheus Izvekov 50f84c70a3SMatheus Izvekov; ------------------------------------------------------------------------------ 51f84c70a3SMatheus Izvekov 52f84c70a3SMatheus Izvekov; ModuleID = 'a.cpp' 53f84c70a3SMatheus Izvekovsource_filename = "a.cpp" 54f84c70a3SMatheus Izvekovtarget datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" 55f84c70a3SMatheus Izvekovtarget triple = "x86_64-unknown-windows-gnu" 56f84c70a3SMatheus Izvekov 57f84c70a3SMatheus Izvekov%struct.test = type { i8 } 58f84c70a3SMatheus Izvekov 59f84c70a3SMatheus Izvekov; Function Attrs: mustprogress noinline nounwind optnone 60f84c70a3SMatheus Izvekovdefine dso_local <2 x i64> @_Z2t1v() #0 !dbg !23 { 61f84c70a3SMatheus Izvekoventry: 62f84c70a3SMatheus Izvekov %retval = alloca i128, align 16 63*5a288fa3SNikita Popov store i128 18446744073709551616, ptr %retval, align 16, !dbg !27 64*5a288fa3SNikita Popov %0 = load <2 x i64>, ptr %retval, align 16, !dbg !27 65*5a288fa3SNikita Popov ret <2 x i64> %0, !dbg !27 66f84c70a3SMatheus Izvekov} 67f84c70a3SMatheus Izvekov 68f84c70a3SMatheus Izvekov; Function Attrs: mustprogress noinline nounwind optnone 69f84c70a3SMatheus Izvekovdefine dso_local <2 x i64> @_Z2t2v() #0 !dbg !28 { 70f84c70a3SMatheus Izvekoventry: 71f84c70a3SMatheus Izvekov %retval = alloca i128, align 16 72*5a288fa3SNikita Popov store i128 -18446744073709551616, ptr %retval, align 16, !dbg !31 73*5a288fa3SNikita Popov %0 = load <2 x i64>, ptr %retval, align 16, !dbg !31 74*5a288fa3SNikita Popov ret <2 x i64> %0, !dbg !31 75f84c70a3SMatheus Izvekov} 76f84c70a3SMatheus Izvekov 77f84c70a3SMatheus Izvekov; Function Attrs: mustprogress noinline nounwind optnone 78f84c70a3SMatheus Izvekovdefine dso_local i8 @_Z2t3v() #1 !dbg !32 { 79f84c70a3SMatheus Izvekoventry: 80f84c70a3SMatheus Izvekov %retval = alloca %struct.test, align 1 81*5a288fa3SNikita Popov %0 = load i8, ptr %retval, align 1, !dbg !41 82f84c70a3SMatheus Izvekov ret i8 %0, !dbg !41 83f84c70a3SMatheus Izvekov} 84f84c70a3SMatheus Izvekov 85f84c70a3SMatheus Izvekovattributes #0 = { mustprogress noinline nounwind optnone "frame-pointer"="none" "min-legal-vector-width"="128" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" } 86f84c70a3SMatheus Izvekovattributes #1 = { mustprogress noinline nounwind optnone "frame-pointer"="none" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" } 87f84c70a3SMatheus Izvekov 88f84c70a3SMatheus Izvekov!llvm.dbg.cu = !{!0} 89f84c70a3SMatheus Izvekov!llvm.module.flags = !{!19, !20, !21} 90f84c70a3SMatheus Izvekov!llvm.ident = !{!22} 91f84c70a3SMatheus Izvekov 92f84c70a3SMatheus Izvekov!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 13.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !14, splitDebugInlining: false, nameTableKind: None) 93f84c70a3SMatheus Izvekov!1 = !DIFile(filename: "a.cpp", directory: ".", checksumkind: CSK_MD5, checksum: "b37f4034fd610917975e9c5ff097fa6b") 94f84c70a3SMatheus Izvekov!2 = !{!3, !10} 95f84c70a3SMatheus Izvekov!3 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "uns", file: !4, line: 4, baseType: !5, size: 128, flags: DIFlagEnumClass, elements: !8, identifier: "_ZTS3uns") 96f84c70a3SMatheus Izvekov!4 = !DIFile(filename: "a.cpp", directory: ".", checksumkind: CSK_MD5, checksum: "b37f4034fd610917975e9c5ff097fa6b") 97f84c70a3SMatheus Izvekov!5 = !DIDerivedType(tag: DW_TAG_typedef, name: "__uint128_t", file: !6, baseType: !7) 98f84c70a3SMatheus Izvekov!6 = !DIFile(filename: "a.cpp", directory: ".") 99f84c70a3SMatheus Izvekov!7 = !DIBasicType(name: "unsigned __int128", size: 128, encoding: DW_ATE_unsigned) 100f84c70a3SMatheus Izvekov!8 = !{!9} 101f84c70a3SMatheus Izvekov!9 = !DIEnumerator(name: "unsval", value: 18446744073709551616, isUnsigned: true) 102f84c70a3SMatheus Izvekov!10 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "sig", file: !4, line: 7, baseType: !11, size: 128, flags: DIFlagEnumClass, elements: !12, identifier: "_ZTS3sig") 103f84c70a3SMatheus Izvekov!11 = !DIBasicType(name: "__int128", size: 128, encoding: DW_ATE_signed) 104f84c70a3SMatheus Izvekov!12 = !{!13} 105f84c70a3SMatheus Izvekov!13 = !DIEnumerator(name: "sigval", value: -18446744073709551616) 106f84c70a3SMatheus Izvekov!14 = !{!15, !17} 107f84c70a3SMatheus Izvekov!15 = !DIGlobalVariableExpression(var: !16, expr: !DIExpression()) 108f84c70a3SMatheus Izvekov!16 = distinct !DIGlobalVariable(name: "unsval", scope: !0, file: !4, line: 4, type: !3, isLocal: true, isDefinition: true) 109f84c70a3SMatheus Izvekov!17 = !DIGlobalVariableExpression(var: !18, expr: !DIExpression()) 110f84c70a3SMatheus Izvekov!18 = distinct !DIGlobalVariable(name: "sigval", scope: !0, file: !4, line: 7, type: !10, isLocal: true, isDefinition: true) 111f84c70a3SMatheus Izvekov!19 = !{i32 2, !"CodeView", i32 1} 112f84c70a3SMatheus Izvekov!20 = !{i32 2, !"Debug Info Version", i32 3} 113f84c70a3SMatheus Izvekov!21 = !{i32 1, !"wchar_size", i32 2} 114f84c70a3SMatheus Izvekov!22 = !{!"clang version 13.0.0"} 115f84c70a3SMatheus Izvekov!23 = distinct !DISubprogram(name: "t1", linkageName: "_Z2t1v", scope: !4, file: !4, line: 5, type: !24, scopeLine: 5, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !26) 116f84c70a3SMatheus Izvekov!24 = !DISubroutineType(types: !25) 117f84c70a3SMatheus Izvekov!25 = !{!3} 118f84c70a3SMatheus Izvekov!26 = !{} 119f84c70a3SMatheus Izvekov!27 = !DILocation(line: 5, column: 12, scope: !23) 120f84c70a3SMatheus Izvekov!28 = distinct !DISubprogram(name: "t2", linkageName: "_Z2t2v", scope: !4, file: !4, line: 8, type: !29, scopeLine: 8, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !26) 121f84c70a3SMatheus Izvekov!29 = !DISubroutineType(types: !30) 122f84c70a3SMatheus Izvekov!30 = !{!10} 123f84c70a3SMatheus Izvekov!31 = !DILocation(line: 8, column: 12, scope: !28) 124f84c70a3SMatheus Izvekov!32 = distinct !DISubprogram(name: "t3", linkageName: "_Z2t3v", scope: !4, file: !4, line: 14, type: !33, scopeLine: 14, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !26) 125f84c70a3SMatheus Izvekov!33 = !DISubroutineType(types: !34) 126f84c70a3SMatheus Izvekov!34 = !{!35} 127f84c70a3SMatheus Izvekov!35 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "test", file: !4, line: 10, size: 8, flags: DIFlagTypePassByValue, elements: !36, identifier: "_ZTS4test") 128f84c70a3SMatheus Izvekov!36 = !{!37, !39} 129f84c70a3SMatheus Izvekov!37 = !DIDerivedType(tag: DW_TAG_member, name: "u128", scope: !35, file: !4, line: 11, baseType: !38, flags: DIFlagStaticMember, extraData: i128 18446744073709551616) 130f84c70a3SMatheus Izvekov!38 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !5) 131f84c70a3SMatheus Izvekov!39 = !DIDerivedType(tag: DW_TAG_member, name: "s128", scope: !35, file: !4, line: 12, baseType: !40, flags: DIFlagStaticMember, extraData: i128 -18446744073709551616) 132f84c70a3SMatheus Izvekov!40 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !11) 133f84c70a3SMatheus Izvekov!41 = !DILocation(line: 14, column: 13, scope: !32) 134