@@ -1,4 +1,4 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
; RUN: opt -passes=sroa -S %s -o - -experimental-assignment-tracking \
; RUN: | FileCheck %s --implicit-check-not="call void @llvm.dbg"
Expand Down
Expand Up
@@ -48,6 +48,9 @@ target triple = "x86_64-unknown-linux-gnu"
@__const._Z3funv.other = private unnamed_addr constant %struct.V3i { i64 10 , i64 9 , i64 8 }, align 8
; Function Attrs: nounwind uwtable mustprogress
;.
; CHECK: @[[__CONST__Z3FUNV_OTHER:[a-zA-Z0-9_$"\\.-]+]] = private unnamed_addr constant [[STRUCT_V3I:%.*]] { i64 10, i64 9, i64 8 }, align 8
;.
define dso_local void @_Z3funv () !dbg !100 {
; CHECK-LABEL: @_Z3funv(
; CHECK-NEXT: entry:
Expand Down
Expand Up
@@ -235,3 +238,136 @@ declare void @llvm.dbg.assign(metadata, metadata, metadata, metadata, metadata,
!131 = !DILocation (line: 8 , column: 32 , scope: !100 )
!132 = distinct !DIAssignID ()
!133 = !DILocation (line: 9 , column: 1 , scope: !100 )
;.
; CHECK: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
; CHECK: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
; CHECK: attributes #[[ATTR2:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: write) }
; CHECK: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
;.
; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 12.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, imports: !3, splitDebugInlining: false, nameTableKind: None)
; CHECK: [[META1:![0-9]+]] = !DIFile(filename: "test.cpp", directory: "/")
; CHECK: [[META2:![0-9]+]] = !{}
; CHECK: [[META3:![0-9]+]] = !{!4, !18, !22, !28, !32, !36, !46, !50, !52, !54, !58, !62, !66, !70, !74, !76, !78, !80, !84, !88, !92, !94}
; CHECK: [[META4:![0-9]+]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !6, file: !17, line: 75)
; CHECK: [[META5:![0-9]+]] = !DINamespace(name: "std", scope: null)
; CHECK: [[META6:![0-9]+]] = !DISubprogram(name: "memchr", scope: !7, file: !7, line: 90, type: !8, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
; CHECK: [[META7:![0-9]+]] = !DIFile(filename: "/usr/include/string.h", directory: "")
; CHECK: [[META8:![0-9]+]] = !DISubroutineType(types: !9)
; CHECK: [[META9:![0-9]+]] = !{!10, !11, !13, !14}
; CHECK: [[META10:![0-9]+]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
; CHECK: [[META11:![0-9]+]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !12, size: 64)
; CHECK: [[META12:![0-9]+]] = !DIDerivedType(tag: DW_TAG_const_type, baseType: null)
; CHECK: [[META13:![0-9]+]] = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
; CHECK: [[META14:![0-9]+]] = !DIDerivedType(tag: DW_TAG_typedef, name: "size_t", file: !15, line: 46, baseType: !16)
; CHECK: [[META15:![0-9]+]] = !DIFile(filename: "lib/clang/12.0.0/include/stddef.h", directory: "/")
; CHECK: [[META16:![0-9]+]] = !DIBasicType(name: "long unsigned int", size: 64, encoding: DW_ATE_unsigned)
; CHECK: [[META17:![0-9]+]] = !DIFile(filename: "/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/cstring", directory: "")
; CHECK: [[META18:![0-9]+]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !19, file: !17, line: 76)
; CHECK: [[META19:![0-9]+]] = !DISubprogram(name: "memcmp", scope: !7, file: !7, line: 63, type: !20, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
; CHECK: [[META20:![0-9]+]] = !DISubroutineType(types: !21)
; CHECK: [[META21:![0-9]+]] = !{!13, !11, !11, !14}
; CHECK: [[META22:![0-9]+]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !23, file: !17, line: 77)
; CHECK: [[META23:![0-9]+]] = !DISubprogram(name: "memcpy", scope: !7, file: !7, line: 42, type: !24, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
; CHECK: [[META24:![0-9]+]] = !DISubroutineType(types: !25)
; CHECK: [[META25:![0-9]+]] = !{!10, !26, !27, !14}
; CHECK: [[META26:![0-9]+]] = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: !10)
; CHECK: [[META27:![0-9]+]] = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: !11)
; CHECK: [[META28:![0-9]+]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !29, file: !17, line: 78)
; CHECK: [[META29:![0-9]+]] = !DISubprogram(name: "memmove", scope: !7, file: !7, line: 46, type: !30, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
; CHECK: [[META30:![0-9]+]] = !DISubroutineType(types: !31)
; CHECK: [[META31:![0-9]+]] = !{!10, !10, !11, !14}
; CHECK: [[META32:![0-9]+]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !33, file: !17, line: 79)
; CHECK: [[META33:![0-9]+]] = !DISubprogram(name: "memset", scope: !7, file: !7, line: 60, type: !34, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
; CHECK: [[META34:![0-9]+]] = !DISubroutineType(types: !35)
; CHECK: [[META35:![0-9]+]] = !{!10, !10, !13, !14}
; CHECK: [[META36:![0-9]+]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !37, file: !17, line: 80)
; CHECK: [[META37:![0-9]+]] = !DISubprogram(name: "strcat", scope: !7, file: !7, line: 129, type: !38, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
; CHECK: [[META38:![0-9]+]] = !DISubroutineType(types: !39)
; CHECK: [[META39:![0-9]+]] = !{!40, !42, !43}
; CHECK: [[META40:![0-9]+]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !41, size: 64)
; CHECK: [[META41:![0-9]+]] = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
; CHECK: [[META42:![0-9]+]] = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: !40)
; CHECK: [[META43:![0-9]+]] = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: !44)
; CHECK: [[META44:![0-9]+]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !45, size: 64)
; CHECK: [[META45:![0-9]+]] = !DIDerivedType(tag: DW_TAG_const_type, baseType: !41)
; CHECK: [[META46:![0-9]+]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !47, file: !17, line: 81)
; CHECK: [[META47:![0-9]+]] = !DISubprogram(name: "strcmp", scope: !7, file: !7, line: 136, type: !48, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
; CHECK: [[META48:![0-9]+]] = !DISubroutineType(types: !49)
; CHECK: [[META49:![0-9]+]] = !{!13, !44, !44}
; CHECK: [[META50:![0-9]+]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !51, file: !17, line: 82)
; CHECK: [[META51:![0-9]+]] = !DISubprogram(name: "strcoll", scope: !7, file: !7, line: 143, type: !48, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
; CHECK: [[META52:![0-9]+]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !53, file: !17, line: 83)
; CHECK: [[META53:![0-9]+]] = !DISubprogram(name: "strcpy", scope: !7, file: !7, line: 121, type: !38, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
; CHECK: [[META54:![0-9]+]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !55, file: !17, line: 84)
; CHECK: [[META55:![0-9]+]] = !DISubprogram(name: "strcspn", scope: !7, file: !7, line: 272, type: !56, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
; CHECK: [[META56:![0-9]+]] = !DISubroutineType(types: !57)
; CHECK: [[META57:![0-9]+]] = !{!14, !44, !44}
; CHECK: [[META58:![0-9]+]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !59, file: !17, line: 85)
; CHECK: [[META59:![0-9]+]] = !DISubprogram(name: "strerror", scope: !7, file: !7, line: 396, type: !60, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
; CHECK: [[META60:![0-9]+]] = !DISubroutineType(types: !61)
; CHECK: [[META61:![0-9]+]] = !{!40, !13}
; CHECK: [[META62:![0-9]+]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !63, file: !17, line: 86)
; CHECK: [[META63:![0-9]+]] = !DISubprogram(name: "strlen", scope: !7, file: !7, line: 384, type: !64, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
; CHECK: [[META64:![0-9]+]] = !DISubroutineType(types: !65)
; CHECK: [[META65:![0-9]+]] = !{!14, !44}
; CHECK: [[META66:![0-9]+]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !67, file: !17, line: 87)
; CHECK: [[META67:![0-9]+]] = !DISubprogram(name: "strncat", scope: !7, file: !7, line: 132, type: !68, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
; CHECK: [[META68:![0-9]+]] = !DISubroutineType(types: !69)
; CHECK: [[META69:![0-9]+]] = !{!40, !42, !43, !14}
; CHECK: [[META70:![0-9]+]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !71, file: !17, line: 88)
; CHECK: [[META71:![0-9]+]] = !DISubprogram(name: "strncmp", scope: !7, file: !7, line: 139, type: !72, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
; CHECK: [[META72:![0-9]+]] = !DISubroutineType(types: !73)
; CHECK: [[META73:![0-9]+]] = !{!13, !44, !44, !14}
; CHECK: [[META74:![0-9]+]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !75, file: !17, line: 89)
; CHECK: [[META75:![0-9]+]] = !DISubprogram(name: "strncpy", scope: !7, file: !7, line: 124, type: !68, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
; CHECK: [[META76:![0-9]+]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !77, file: !17, line: 90)
; CHECK: [[META77:![0-9]+]] = !DISubprogram(name: "strspn", scope: !7, file: !7, line: 276, type: !56, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
; CHECK: [[META78:![0-9]+]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !79, file: !17, line: 91)
; CHECK: [[META79:![0-9]+]] = !DISubprogram(name: "strtok", scope: !7, file: !7, line: 335, type: !38, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
; CHECK: [[META80:![0-9]+]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !81, file: !17, line: 92)
; CHECK: [[META81:![0-9]+]] = !DISubprogram(name: "strxfrm", scope: !7, file: !7, line: 146, type: !82, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
; CHECK: [[META82:![0-9]+]] = !DISubroutineType(types: !83)
; CHECK: [[META83:![0-9]+]] = !{!14, !42, !43, !14}
; CHECK: [[META84:![0-9]+]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !85, file: !17, line: 93)
; CHECK: [[META85:![0-9]+]] = !DISubprogram(name: "strchr", scope: !7, file: !7, line: 225, type: !86, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
; CHECK: [[META86:![0-9]+]] = !DISubroutineType(types: !87)
; CHECK: [[META87:![0-9]+]] = !{!40, !44, !13}
; CHECK: [[META88:![0-9]+]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !89, file: !17, line: 94)
; CHECK: [[META89:![0-9]+]] = !DISubprogram(name: "strpbrk", scope: !7, file: !7, line: 302, type: !90, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
; CHECK: [[META90:![0-9]+]] = !DISubroutineType(types: !91)
; CHECK: [[META91:![0-9]+]] = !{!40, !44, !44}
; CHECK: [[META92:![0-9]+]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !93, file: !17, line: 95)
; CHECK: [[META93:![0-9]+]] = !DISubprogram(name: "strrchr", scope: !7, file: !7, line: 252, type: !86, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
; CHECK: [[META94:![0-9]+]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !95, file: !17, line: 96)
; CHECK: [[META95:![0-9]+]] = !DISubprogram(name: "strstr", scope: !7, file: !7, line: 329, type: !90, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
; CHECK: [[META96:![0-9]+]] = !{i32 7, !"Dwarf Version", i32 4}
; CHECK: [[META97:![0-9]+]] = !{i32 2, !"Debug Info Version", i32 3}
; CHECK: [[META98:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
; CHECK: [[META99:![0-9]+]] = !{!"clang version 12.0.0"}
; CHECK: [[META100:![0-9]+]] = distinct !DISubprogram(name: "fun", linkageName: "_Z3funv", scope: !1, file: !1, line: 4, type: !101, scopeLine: 4, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !103)
; CHECK: [[META101:![0-9]+]] = !DISubroutineType(types: !102)
; CHECK: [[META102:![0-9]+]] = !{null}
; CHECK: [[META103:![0-9]+]] = !{!104, !111}
; CHECK: [[META104]] = !DILocalVariable(name: "point", scope: !100, file: !1, line: 5, type: !105)
; CHECK: [[META105:![0-9]+]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "V3i", file: !1, line: 3, size: 192, flags: DIFlagTypePassByValue, elements: !106, identifier: "_ZTS3V3i")
; CHECK: [[META106:![0-9]+]] = !{!107, !109, !110}
; CHECK: [[META107:![0-9]+]] = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !105, file: !1, line: 3, baseType: !108, size: 64)
; CHECK: [[META108:![0-9]+]] = !DIBasicType(name: "long int", size: 64, encoding: DW_ATE_signed)
; CHECK: [[META109:![0-9]+]] = !DIDerivedType(tag: DW_TAG_member, name: "y", scope: !105, file: !1, line: 3, baseType: !108, size: 64, offset: 64)
; CHECK: [[META110:![0-9]+]] = !DIDerivedType(tag: DW_TAG_member, name: "z", scope: !105, file: !1, line: 3, baseType: !108, size: 64, offset: 128)
; CHECK: [[META111]] = !DILocalVariable(name: "other", scope: !100, file: !1, line: 7, type: !105)
; CHECK: [[META112]] = distinct !DIAssignID()
; CHECK: [[DBG113]] = !DILocation(line: 5, column: 7, scope: !100)
; CHECK: [[META114]] = distinct !DIAssignID()
; CHECK: [[META115]] = distinct !DIAssignID()
; CHECK: [[META116]] = distinct !DIAssignID()
; CHECK: [[DBG117]] = !DILocation(line: 6, column: 11, scope: !100)
; CHECK: [[DBG118]] = !DILocation(line: 7, column: 7, scope: !100)
; CHECK: [[META119]] = distinct !DIAssignID()
; CHECK: [[META120]] = distinct !DIAssignID()
; CHECK: [[META121]] = distinct !DIAssignID()
; CHECK: [[META122]] = distinct !DIAssignID()
; CHECK: [[DBG123]] = !DILocation(line: 8, column: 3, scope: !100)
; CHECK: [[META124]] = distinct !DIAssignID()
; CHECK: [[DBG125]] = !DILocation(line: 9, column: 1, scope: !100)
;.