--- /dev/null
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
+; RUN: verify-uselistorder %s
+
+; CHECK: !named = !{!0, !1, !2, !3, !4, !5, !6, !7, !7, !8, !8}
+!named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9, !10}
+
+!0 = distinct !{}
+!1 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
+!2 = distinct !{}
+!3 = distinct !{}
+!4 = distinct !{}
+!5 = distinct !{}
+!6 = distinct !{}
+
+; CHECK: !7 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: true, flags: "-O2", runtimeVersion: 2, splitDebugFilename: "abc.debug", emissionKind: 3, enums: !2, retainedTypes: !3, subprograms: !4, globals: !5, imports: !6, dwoId: 42)
+!7 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang",
+ isOptimized: true, flags: "-O2", runtimeVersion: 2,
+ splitDebugFilename: "abc.debug", emissionKind: 3,
+ enums: !2, retainedTypes: !3, subprograms: !4,
+ globals: !5, imports: !6, dwoId: 42)
+!8 = !DICompileUnit(language: 12, file: !1, producer: "clang",
+ isOptimized: true, flags: "-O2", runtimeVersion: 2,
+ splitDebugFilename: "abc.debug", emissionKind: 3,
+ enums: !2, retainedTypes: !3, subprograms: !4,
+ globals: !5, imports: !6, dwoId: 42)
+
+; CHECK: !8 = !DICompileUnit(language: DW_LANG_C99, file: !1, isOptimized: false, runtimeVersion: 0, emissionKind: 0)
+!9 = !DICompileUnit(language: 12, file: !1, producer: "",
+ isOptimized: false, flags: "", runtimeVersion: 0,
+ splitDebugFilename: "", emissionKind: 0)
+!10 = !DICompileUnit(language: 12, file: !1)
--- /dev/null
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
+; RUN: verify-uselistorder %s
+
+; CHECK: !named = !{!0, !1, !2, !3, !4}
+!named = !{!0, !1, !2, !3, !4}
+
+; CHECK: !0 = !DIExpression()
+; CHECK-NEXT: !1 = !DIExpression(DW_OP_deref)
+; CHECK-NEXT: !2 = !DIExpression(DW_OP_plus, 3)
+; CHECK-NEXT: !3 = !DIExpression(DW_OP_bit_piece, 3, 7)
+; CHECK-NEXT: !4 = !DIExpression(DW_OP_deref, DW_OP_plus, 3, DW_OP_bit_piece, 3, 7)
+!0 = !DIExpression()
+!1 = !DIExpression(DW_OP_deref)
+!2 = !DIExpression(DW_OP_plus, 3)
+!3 = !DIExpression(DW_OP_bit_piece, 3, 7)
+!4 = !DIExpression(DW_OP_deref, DW_OP_plus, 3, DW_OP_bit_piece, 3, 7)
--- /dev/null
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
+; RUN: verify-uselistorder %s
+
+; Spot-check that metadata string fields are correctly escaped.
+
+!named = !{!0}
+
+; CHECK: !0 = !DIFile(filename: "\00\01\02\80\81\82\FD\FE\FF", directory: "/dir")
+!0 = !DIFile(filename: "\00\01\02\80\81\82\FD\FE\FF", directory: "/dir")
--- /dev/null
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
+; RUN: verify-uselistorder %s
+
+@foo = global i32 0
+
+; CHECK: !named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9}
+!named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9}
+
+!0 = !DIFile(filename: "scope.h", directory: "/path/to/dir")
+!1 = distinct !{}
+!2 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
+!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!4 = distinct !{}
+
+; CHECK: !5 = !DIGlobalVariable(name: "foo", linkageName: "foo", scope: !0, file: !2, line: 7, type: !3, isLocal: true, isDefinition: false, variable: i32* @foo)
+!5 = !DIGlobalVariable(name: "foo", linkageName: "foo", scope: !0,
+ file: !2, line: 7, type: !3, isLocal: true,
+ isDefinition: false, variable: i32* @foo)
+
+; CHECK: !6 = !DIGlobalVariable(name: "foo", scope: !0, isLocal: false, isDefinition: true)
+!6 = !DIGlobalVariable(name: "foo", scope: !0)
+
+!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "Class", size: 8, align: 8)
+!8 = !DIDerivedType(tag: DW_TAG_member, name: "mem", flags: DIFlagStaticMember, scope: !7, baseType: !3)
+
+; CHECK: !9 = !DIGlobalVariable(name: "mem", scope: !0, isLocal: false, isDefinition: true, declaration: !8)
+!9 = !DIGlobalVariable(name: "mem", scope: !0, declaration: !8)
--- /dev/null
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
+; RUN: verify-uselistorder %s
+
+; CHECK: !named = !{!0, !1, !2, !3, !3}
+!named = !{!0, !1, !2, !3, !4}
+
+; CHECK: !0 = !DISubprogram({{.*}})
+; CHECK-NEXT: !1 = !DICompositeType({{.*}})
+!0 = !DISubprogram(name: "foo")
+!1 = !DICompositeType(tag: DW_TAG_structure_type, name: "Class", size: 32, align: 32)
+
+; CHECK-NEXT: !2 = !DIImportedEntity(tag: DW_TAG_imported_module, name: "foo", scope: !0, entity: !1, line: 7)
+!2 = !DIImportedEntity(tag: DW_TAG_imported_module, name: "foo", scope: !0,
+ entity: !1, line: 7)
+
+; CHECK-NEXT: !3 = !DIImportedEntity(tag: DW_TAG_imported_module, scope: !0)
+!3 = !DIImportedEntity(tag: DW_TAG_imported_module, scope: !0)
+!4 = !DIImportedEntity(tag: DW_TAG_imported_module, name: "", scope: !0, entity: null,
+ line: 0)
+
--- /dev/null
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
+; RUN: verify-uselistorder %s
+
+; CHECK: !named = !{!0, !1, !2, !3, !4, !4, !5, !6, !7, !7}
+!named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9}
+
+!0 = distinct !{}
+!1 = !DISubprogram(name: "foo", scope: !2)
+!2 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
+
+; CHECK: !3 = !DILexicalBlock(scope: !1, file: !2, line: 7, column: 35)
+!3 = !DILexicalBlock(scope: !1, file: !2, line: 7, column: 35)
+
+; CHECK: !4 = !DILexicalBlock(scope: !1)
+!4 = !DILexicalBlock(scope: !1)
+!5 = !DILexicalBlock(scope: !1, file: null, line: 0, column: 0)
+
+; CHECK: !5 = !DILexicalBlockFile(scope: !3, file: !2, discriminator: 0)
+; CHECK: !6 = !DILexicalBlockFile(scope: !3, file: !2, discriminator: 1)
+!6 = !DILexicalBlockFile(scope: !3, file: !2, discriminator: 0)
+!7 = !DILexicalBlockFile(scope: !3, file: !2, discriminator: 1)
+
+; CHECK: !7 = !DILexicalBlockFile(scope: !3, discriminator: 7)
+!8 = !DILexicalBlockFile(scope: !3, discriminator: 7)
+!9 = !DILexicalBlockFile(scope: !3, file: null, discriminator: 7)
--- /dev/null
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
+; RUN: verify-uselistorder %s
+
+@foo = global i32 0
+
+; CHECK: !named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8}
+!named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8}
+
+!0 = distinct !DISubprogram()
+!1 = distinct !{}
+!2 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
+!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!4 = !DILocation(scope: !0)
+
+; CHECK: !5 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "foo", arg: 3, scope: !0, file: !2, line: 7, type: !3, flags: DIFlagArtificial)
+; CHECK: !6 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "foo", scope: !0, file: !2, line: 7, type: !3, flags: DIFlagArtificial)
+!5 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "foo", arg: 3,
+ scope: !0, file: !2, line: 7, type: !3,
+ flags: DIFlagArtificial)
+!6 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "foo", scope: !0,
+ file: !2, line: 7, type: !3, flags: DIFlagArtificial)
+
+; CHECK: !7 = !DILocalVariable(tag: DW_TAG_arg_variable, arg: 0, scope: !0)
+; CHECK: !8 = !DILocalVariable(tag: DW_TAG_auto_variable, scope: !0)
+!7 = !DILocalVariable(tag: DW_TAG_arg_variable, scope: !0)
+!8 = !DILocalVariable(tag: DW_TAG_auto_variable, scope: !0)
--- /dev/null
+; RUN: llvm-as < %s | llvm-dis | FileCheck %s
+; RUN: verify-uselistorder %s
+
+; CHECK: !named = !{!0, !1, !1, !2, !2, !3, !3, !4}
+!named = !{!0, !1, !2, !3, !4, !5, !6, !7}
+
+; CHECK: !0 = !DISubprogram(
+!0 = !DISubprogram()
+
+; CHECK-NEXT: !1 = !DILocation(line: 3, column: 7, scope: !0)
+!1 = !DILocation(line: 3, column: 7, scope: !0)
+!2 = !DILocation(scope: !0, column: 7, line: 3)
+
+; CHECK-NEXT: !2 = !DILocation(line: 3, column: 7, scope: !0, inlinedAt: !1)
+!3 = !DILocation(scope: !0, inlinedAt: !1, column: 7, line: 3)
+!4 = !DILocation(column: 7, line: 3, scope: !0, inlinedAt: !1)
+
+; CHECK-NEXT: !3 = !DILocation(line: 0, scope: !0)
+!5 = !DILocation(scope: !0)
+!6 = !DILocation(scope: !0, column: 0, line: 0)
+
+; CHECK-NEXT: !4 = !DILocation(line: 4294967295, column: 65535, scope: !0)
+!7 = !DILocation(line: 4294967295, column: 65535, scope: !0)
--- /dev/null
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
+; RUN: verify-uselistorder %s
+
+; CHECK: !named = !{!0, !1, !2, !3, !4, !4}
+!named = !{!0, !1, !2, !3, !4, !5}
+
+!0 = !DIFile(filename: "file.cpp", directory: "/path/to/dir")
+!1 = distinct !{}
+!2 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
+
+; CHECK: !3 = !DINamespace(name: "Namespace", scope: !0, file: !2, line: 7)
+!3 = !DINamespace(name: "Namespace", scope: !0, file: !2, line: 7)
+
+; CHECK: !4 = !DINamespace(scope: !0)
+!4 = !DINamespace(name: "", scope: !0, file: null, line: 0)
+!5 = !DINamespace(scope: !0)
--- /dev/null
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
+; RUN: verify-uselistorder %s
+
+; CHECK: !named = !{!0, !1, !2, !3, !4, !4}
+!named = !{!0, !1, !2, !3, !4, !5}
+
+!0 = distinct !{}
+!1 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
+!2 = !DICompositeType(tag: DW_TAG_structure_type, name: "Object")
+
+; CHECK: !2 = !DICompositeType({{.*}})
+; CHECK-NEXT: !3 = !DIObjCProperty(name: "foo", file: !1, line: 7, setter: "setFoo", getter: "getFoo", attributes: 7, type: !2)
+!3 = !DIObjCProperty(name: "foo", file: !1, line: 7, setter: "setFoo",
+ getter: "getFoo", attributes: 7, type: !2)
+
+; CHECK-NEXT: !4 = !DIObjCProperty()
+!4 = !DIObjCProperty(name: "", file: null, line: 0, setter: "", getter: "",
+ attributes: 0, type: null)
+!5 = !DIObjCProperty()
--- /dev/null
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
+; RUN: verify-uselistorder %s
+
+declare void @_Z3foov()
+
+; CHECK: !named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9}
+!named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9}
+
+!0 = !{null}
+!1 = distinct !DICompositeType(tag: DW_TAG_structure_type)
+!2 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
+!3 = !DISubroutineType(types: !0)
+!4 = distinct !DICompositeType(tag: DW_TAG_structure_type)
+!5 = distinct !{}
+!6 = distinct !DISubprogram(isDefinition: false)
+!7 = distinct !{}
+
+; CHECK: !8 = !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1, file: !2, line: 7, type: !3, isLocal: true, isDefinition: false, scopeLine: 8, containingType: !4, virtuality: DW_VIRTUALITY_pure_virtual, virtualIndex: 10, flags: DIFlagPrototyped, isOptimized: true, function: void ()* @_Z3foov, templateParams: !5, declaration: !6, variables: !7)
+!8 = !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1,
+ file: !2, line: 7, type: !3, isLocal: true,
+ isDefinition: false, scopeLine: 8, containingType: !4,
+ virtuality: DW_VIRTUALITY_pure_virtual, virtualIndex: 10,
+ flags: DIFlagPrototyped, isOptimized: true, function: void ()* @_Z3foov,
+ templateParams: !5, declaration: !6, variables: !7)
+
+; CHECK: !9 = !DISubprogram(scope: null, isLocal: false, isDefinition: true, isOptimized: false)
+!9 = !DISubprogram()
+
--- /dev/null
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
+; RUN: verify-uselistorder %s
+
+; CHECK: !named = !{!0, !0, !1, !2}
+!named = !{!0, !1, !2, !3}
+
+; CHECK: !0 = !DISubrange(count: -1)
+; CHECK-NEXT: !1 = !DISubrange(count: -1, lowerBound: 4)
+; CHECK-NEXT: !2 = !DISubrange(count: -1, lowerBound: -5)
+!0 = !DISubrange(count: -1)
+!1 = !DISubrange(count: -1, lowerBound: 0)
+
+!2 = !DISubrange(count: -1, lowerBound: 4)
+!3 = !DISubrange(count: -1, lowerBound: -5)
--- /dev/null
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
+; RUN: verify-uselistorder %s
+
+; CHECK: !named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8}
+!named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8}
+
+!0 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!1 = !{null}
+!2 = !{null, !0}
+!3 = !{!0, !0, !0}
+
+
+; CHECK: !4 = !DISubroutineType(types: !1)
+; CHECK: !5 = !DISubroutineType(types: !2)
+; CHECK: !6 = !DISubroutineType(types: !3)
+; CHECK: !7 = !DISubroutineType(flags: DIFlagLValueReference, types: !3)
+!4 = !DISubroutineType(types: !1)
+!5 = !DISubroutineType(types: !2)
+!6 = !DISubroutineType(types: !3)
+!7 = !DISubroutineType(flags: DIFlagLValueReference, types: !3)
+
+; CHECK: !8 = !DISubroutineType(types: null)
+!8 = !DISubroutineType(types: null)
--- /dev/null
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
+; RUN: verify-uselistorder %s
+
+; CHECK: !named = !{!0, !1, !2, !3, !3, !4, !5, !5, !6}
+!named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8}
+
+!0 = distinct !{}
+!1 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+; CHECK: !1 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+
+; CHECK-NEXT: !2 = !DITemplateTypeParameter(name: "Ty", type: !1)
+; CHECK-NEXT: !3 = !DITemplateTypeParameter(type: !1)
+!2 = !DITemplateTypeParameter(name: "Ty", type: !1)
+!3 = !DITemplateTypeParameter(type: !1)
+!4 = !DITemplateTypeParameter(name: "", type: !1)
+
+; CHECK-NEXT: !4 = !DITemplateValueParameter(name: "V", type: !1, value: i32 7)
+; CHECK-NEXT: !5 = !DITemplateValueParameter(type: !1, value: i32 7)
+; CHECK-NEXT: !6 = !DITemplateValueParameter(tag: DW_TAG_GNU_template_template_param, name: "param", type: !1, value: !"template")
+!5 = !DITemplateValueParameter(name: "V", type: !1, value: i32 7)
+!6 = !DITemplateValueParameter(type: !1, value: i32 7)
+!7 = !DITemplateValueParameter(tag: DW_TAG_template_value_parameter,
+ name: "", type: !1, value: i32 7)
+!8 = !DITemplateValueParameter(tag: DW_TAG_GNU_template_template_param, name: "param", type: !1, value: !"template")
--- /dev/null
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
+; RUN: verify-uselistorder %s
+
+; CHECK: !named = !{!0, !1, !2}
+!named = !{!0, !1, !2}
+
+; CHECK: !0 = !DIBasicType(name: "name", size: 18446744073709551615, align: 18446744073709551614, encoding: DW_ATE_unsigned_char)
+; CHECK-NEXT: !1 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !0, size: 18446744073709551615, align: 18446744073709551614, offset: 18446744073709551613)
+; CHECK-NEXT: !2 = !DICompositeType(tag: DW_TAG_array_type, baseType: !0, size: 18446744073709551615, align: 18446744073709551614, offset: 18446744073709551613)
+!0 = !DIBasicType(tag: DW_TAG_base_type, name: "name", size: 18446744073709551615, align: 18446744073709551614, encoding: DW_ATE_unsigned_char)
+!1 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !0, size: 18446744073709551615, align: 18446744073709551614, offset: 18446744073709551613)
+!2 = !DICompositeType(tag: DW_TAG_array_type, baseType: !0, size: 18446744073709551615, align: 18446744073709551614, offset: 18446744073709551613)
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: <stdin>:[[@LINE+1]]:31: error: invalid DWARF language 'DW_LANG_NoSuchLanguage'
+!0 = !DICompileUnit(language: DW_LANG_NoSuchLanguage,
+ file: !DIFile(filename: "a", directory: "b"))
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK-NOT: error:
+!0 = !DICompileUnit(language: 65535,
+ file: !DIFile(filename: "a", directory: "b"))
+
+; CHECK: <stdin>:[[@LINE+1]]:31: error: value for 'language' too large, limit is 65535
+!1 = !DICompileUnit(language: 65536,
+ file: !DIFile(filename: "a", directory: "b"))
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: <stdin>:[[@LINE+1]]:65: error: missing required field 'language'
+!0 = !DICompileUnit(file: !DIFile(filename: "a", directory: "b"))
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: <stdin>:[[@LINE+1]]:27: error: 'file' cannot be null
+!0 = !DICompileUnit(file: null)
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: [[@LINE+1]]:36: error: missing required field 'tag'
+!25 = !DICompositeType(name: "Type")
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: [[@LINE+1]]:45: error: missing required field 'baseType'
+!0 = !DIDerivedType(tag: DW_TAG_pointer_type)
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: [[@LINE+1]]:34: error: missing required field 'tag'
+!0 = !DIDerivedType(baseType: !{})
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: [[@LINE+1]]:28: error: missing required field 'name'
+!0 = !DIEnumerator(value: 7)
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: [[@LINE+1]]:32: error: missing required field 'value'
+!0 = !DIEnumerator(name: "name")
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK-NOT: error:
+!0 = !DIExpression(18446744073709551615)
+
+; CHECK: <stdin>:[[@LINE+1]]:20: error: element too large, limit is 18446744073709551615
+!1 = !DIExpression(18446744073709551616)
--- /dev/null
+; RUN: not llvm-as -disable-output < %s 2>&1 | FileCheck -check-prefix VERIFY %s
+; RUN: llvm-as -disable-verify < %s | llvm-dis | FileCheck -check-prefix NOVERIFY %s
+
+; NOVERIFY: !named = !{!0}
+!named = !{!0}
+
+; NOVERIFY: !0 = !DIExpression(0, 1, 9, 7, 2)
+; VERIFY: assembly parsed, but does not verify
+!0 = !DIExpression(0, 1, 9, 7, 2)
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: [[@LINE+1]]:30: error: missing required field 'directory'
+!0 = !DIFile(filename: "file")
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: [[@LINE+1]]:30: error: missing required field 'filename'
+!0 = !DIFile(directory: "dir")
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: <stdin>:[[@LINE+1]]:30: error: 'name' cannot be empty
+!0 = !DIGlobalVariable(name: "")
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: <stdin>:[[@LINE+1]]:24: error: missing required field 'name'
+!0 = !DIGlobalVariable()
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: [[@LINE+1]]:51: error: missing required field 'scope'
+!3 = !DIImportedEntity(tag: DW_TAG_imported_module)
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: [[@LINE+1]]:33: error: missing required field 'tag'
+!3 = !DIImportedEntity(scope: !0)
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: [[@LINE+1]]:29: error: missing required field 'scope'
+!0 = !DILexicalBlock(line: 7)
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: <stdin>:[[@LINE+1]]:29: error: 'scope' cannot be null
+!0 = !DILexicalBlock(scope: null)
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: [[@LINE+1]]:36: error: missing required field 'discriminator'
+!0 = !DILexicalBlockFile(scope: !{})
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: [[@LINE+1]]:42: error: missing required field 'scope'
+!0 = !DILexicalBlockFile(discriminator: 0)
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: <stdin>:[[@LINE+1]]:33: error: 'scope' cannot be null
+!0 = !DILexicalBlockFile(scope: null)
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: <stdin>:[[@LINE+1]]:48: error: missing required field 'scope'
+!0 = !DILocalVariable(tag: DW_TAG_auto_variable)
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: <stdin>:[[@LINE+1]]:45: error: missing required field 'tag'
+!0 = !DILocalVariable(scope: !DISubprogram())
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: <stdin>:[[@LINE+1]]:30: error: 'scope' cannot be null
+!0 = !DILocalVariable(scope: null)
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: <stdin>:[[@LINE+1]]:18: error: invalid field 'bad'
+!0 = !DILocation(bad: 0)
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+!0 = !{}
+
+; CHECK: <stdin>:[[@LINE+1]]:38: error: field 'line' cannot be specified more than once
+!1 = !DILocation(line: 3, scope: !0, line: 3)
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: <stdin>:[[@LINE+1]]:25: error: missing required field 'scope'
+!0 = !DILocation(line: 7)
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: <stdin>:[[@LINE+1]]:18: error: missing required field 'scope'
+!0 = !DILocation()
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: <stdin>:[[@LINE+1]]:25: error: 'scope' cannot be null
+!0 = !DILocation(scope: null)
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+!0 = !{}
+
+; CHECK-NOT: error:
+!1 = !DILocation(column: 65535, scope: !0)
+
+; CHECK: <stdin>:[[@LINE+1]]:26: error: value for 'column' too large, limit is 65535
+!2 = !DILocation(column: 65536, scope: !0)
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+!0 = !{}
+
+; CHECK-NOT: error:
+!1 = !DILocation(line: 4294967295, scope: !0)
+
+; CHECK: <stdin>:[[@LINE+1]]:24: error: value for 'line' too large, limit is 4294967295
+!2 = !DILocation(line: 4294967296, scope: !0)
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: [[@LINE+1]]:36: error: missing required field 'scope'
+!0 = !DINamespace(name: "Namespace")
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK-NOT: error:
+!0 = !DISubrange(count: 9223372036854775807)
+
+; CHECK: <stdin>:[[@LINE+1]]:25: error: value for 'count' too large, limit is 9223372036854775807
+!1 = !DISubrange(count: 9223372036854775808)
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: [[@LINE+1]]:32: error: missing required field 'count'
+!0 = !DISubrange(lowerBound: -3)
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK-NOT: error:
+!0 = !DISubrange(count: -1)
+
+; CHECK: <stdin>:[[@LINE+1]]:25: error: value for 'count' too small, limit is -1
+!0 = !DISubrange(count: -2)
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: [[@LINE+1]]:41: error: value for 'lowerBound' too large, limit is 9223372036854775807
+!0 = !DISubrange(count: 30, lowerBound: 9223372036854775808)
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: [[@LINE+1]]:41: error: value for 'lowerBound' too small, limit is -9223372036854775808
+!0 = !DISubrange(count: 30, lowerBound: -9223372036854775809)
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: [[@LINE+1]]:65: error: missing required field 'types'
+!29 = !DISubroutineType(flags: DIFlagPublic | DIFlagStaticMember)
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: [[@LINE+1]]:44: error: missing required field 'type'
+!0 = !DITemplateTypeParameter(name: "param")
--- /dev/null
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: [[@LINE+2]]:41: error: missing required field 'value'
+!0 = !DITemplateValueParameter(tag: DW_TAG_template_value_parameter,
+ type: !{})
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: <stdin>:[[@LINE+1]]:31: error: invalid DWARF language 'DW_LANG_NoSuchLanguage'
-!0 = !DICompileUnit(language: DW_LANG_NoSuchLanguage,
- file: !DIFile(filename: "a", directory: "b"))
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK-NOT: error:
-!0 = !DICompileUnit(language: 65535,
- file: !DIFile(filename: "a", directory: "b"))
-
-; CHECK: <stdin>:[[@LINE+1]]:31: error: value for 'language' too large, limit is 65535
-!1 = !DICompileUnit(language: 65536,
- file: !DIFile(filename: "a", directory: "b"))
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: <stdin>:[[@LINE+1]]:65: error: missing required field 'language'
-!0 = !DICompileUnit(file: !DIFile(filename: "a", directory: "b"))
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: <stdin>:[[@LINE+1]]:27: error: 'file' cannot be null
-!0 = !DICompileUnit(file: null)
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: [[@LINE+1]]:36: error: missing required field 'tag'
-!25 = !DICompositeType(name: "Type")
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: [[@LINE+1]]:45: error: missing required field 'baseType'
-!0 = !DIDerivedType(tag: DW_TAG_pointer_type)
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: [[@LINE+1]]:34: error: missing required field 'tag'
-!0 = !DIDerivedType(baseType: !{})
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: [[@LINE+1]]:28: error: missing required field 'name'
-!0 = !DIEnumerator(value: 7)
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: [[@LINE+1]]:32: error: missing required field 'value'
-!0 = !DIEnumerator(name: "name")
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK-NOT: error:
-!0 = !DIExpression(18446744073709551615)
-
-; CHECK: <stdin>:[[@LINE+1]]:20: error: element too large, limit is 18446744073709551615
-!1 = !DIExpression(18446744073709551616)
+++ /dev/null
-; RUN: not llvm-as -disable-output < %s 2>&1 | FileCheck -check-prefix VERIFY %s
-; RUN: llvm-as -disable-verify < %s | llvm-dis | FileCheck -check-prefix NOVERIFY %s
-
-; NOVERIFY: !named = !{!0}
-!named = !{!0}
-
-; NOVERIFY: !0 = !DIExpression(0, 1, 9, 7, 2)
-; VERIFY: assembly parsed, but does not verify
-!0 = !DIExpression(0, 1, 9, 7, 2)
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: [[@LINE+1]]:30: error: missing required field 'directory'
-!0 = !DIFile(filename: "file")
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: [[@LINE+1]]:30: error: missing required field 'filename'
-!0 = !DIFile(directory: "dir")
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: <stdin>:[[@LINE+1]]:30: error: 'name' cannot be empty
-!0 = !DIGlobalVariable(name: "")
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: <stdin>:[[@LINE+1]]:24: error: missing required field 'name'
-!0 = !DIGlobalVariable()
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: [[@LINE+1]]:51: error: missing required field 'scope'
-!3 = !DIImportedEntity(tag: DW_TAG_imported_module)
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: [[@LINE+1]]:33: error: missing required field 'tag'
-!3 = !DIImportedEntity(scope: !0)
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: [[@LINE+1]]:29: error: missing required field 'scope'
-!0 = !DILexicalBlock(line: 7)
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: <stdin>:[[@LINE+1]]:29: error: 'scope' cannot be null
-!0 = !DILexicalBlock(scope: null)
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: [[@LINE+1]]:36: error: missing required field 'discriminator'
-!0 = !DILexicalBlockFile(scope: !{})
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: [[@LINE+1]]:42: error: missing required field 'scope'
-!0 = !DILexicalBlockFile(discriminator: 0)
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: <stdin>:[[@LINE+1]]:33: error: 'scope' cannot be null
-!0 = !DILexicalBlockFile(scope: null)
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: <stdin>:[[@LINE+1]]:48: error: missing required field 'scope'
-!0 = !DILocalVariable(tag: DW_TAG_auto_variable)
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: <stdin>:[[@LINE+1]]:45: error: missing required field 'tag'
-!0 = !DILocalVariable(scope: !DISubprogram())
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: <stdin>:[[@LINE+1]]:30: error: 'scope' cannot be null
-!0 = !DILocalVariable(scope: null)
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: <stdin>:[[@LINE+1]]:18: error: invalid field 'bad'
-!0 = !DILocation(bad: 0)
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-!0 = !{}
-
-; CHECK: <stdin>:[[@LINE+1]]:38: error: field 'line' cannot be specified more than once
-!1 = !DILocation(line: 3, scope: !0, line: 3)
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: <stdin>:[[@LINE+1]]:25: error: missing required field 'scope'
-!0 = !DILocation(line: 7)
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: <stdin>:[[@LINE+1]]:18: error: missing required field 'scope'
-!0 = !DILocation()
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: <stdin>:[[@LINE+1]]:25: error: 'scope' cannot be null
-!0 = !DILocation(scope: null)
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-!0 = !{}
-
-; CHECK-NOT: error:
-!1 = !DILocation(column: 65535, scope: !0)
-
-; CHECK: <stdin>:[[@LINE+1]]:26: error: value for 'column' too large, limit is 65535
-!2 = !DILocation(column: 65536, scope: !0)
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-!0 = !{}
-
-; CHECK-NOT: error:
-!1 = !DILocation(line: 4294967295, scope: !0)
-
-; CHECK: <stdin>:[[@LINE+1]]:24: error: value for 'line' too large, limit is 4294967295
-!2 = !DILocation(line: 4294967296, scope: !0)
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: [[@LINE+1]]:36: error: missing required field 'scope'
-!0 = !DINamespace(name: "Namespace")
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK-NOT: error:
-!0 = !DISubrange(count: 9223372036854775807)
-
-; CHECK: <stdin>:[[@LINE+1]]:25: error: value for 'count' too large, limit is 9223372036854775807
-!1 = !DISubrange(count: 9223372036854775808)
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: [[@LINE+1]]:32: error: missing required field 'count'
-!0 = !DISubrange(lowerBound: -3)
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK-NOT: error:
-!0 = !DISubrange(count: -1)
-
-; CHECK: <stdin>:[[@LINE+1]]:25: error: value for 'count' too small, limit is -1
-!0 = !DISubrange(count: -2)
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: [[@LINE+1]]:41: error: value for 'lowerBound' too large, limit is 9223372036854775807
-!0 = !DISubrange(count: 30, lowerBound: 9223372036854775808)
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: [[@LINE+1]]:41: error: value for 'lowerBound' too small, limit is -9223372036854775808
-!0 = !DISubrange(count: 30, lowerBound: -9223372036854775809)
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: [[@LINE+1]]:65: error: missing required field 'types'
-!29 = !DISubroutineType(flags: DIFlagPublic | DIFlagStaticMember)
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: [[@LINE+1]]:44: error: missing required field 'type'
-!0 = !DITemplateTypeParameter(name: "param")
+++ /dev/null
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: [[@LINE+2]]:41: error: missing required field 'value'
-!0 = !DITemplateValueParameter(tag: DW_TAG_template_value_parameter,
- type: !{})
+++ /dev/null
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
-; RUN: verify-uselistorder %s
-
-; CHECK: !named = !{!0, !1, !2, !3, !4, !5, !6, !7, !7, !8, !8}
-!named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9, !10}
-
-!0 = distinct !{}
-!1 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
-!2 = distinct !{}
-!3 = distinct !{}
-!4 = distinct !{}
-!5 = distinct !{}
-!6 = distinct !{}
-
-; CHECK: !7 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: true, flags: "-O2", runtimeVersion: 2, splitDebugFilename: "abc.debug", emissionKind: 3, enums: !2, retainedTypes: !3, subprograms: !4, globals: !5, imports: !6, dwoId: 42)
-!7 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang",
- isOptimized: true, flags: "-O2", runtimeVersion: 2,
- splitDebugFilename: "abc.debug", emissionKind: 3,
- enums: !2, retainedTypes: !3, subprograms: !4,
- globals: !5, imports: !6, dwoId: 42)
-!8 = !DICompileUnit(language: 12, file: !1, producer: "clang",
- isOptimized: true, flags: "-O2", runtimeVersion: 2,
- splitDebugFilename: "abc.debug", emissionKind: 3,
- enums: !2, retainedTypes: !3, subprograms: !4,
- globals: !5, imports: !6, dwoId: 42)
-
-; CHECK: !8 = !DICompileUnit(language: DW_LANG_C99, file: !1, isOptimized: false, runtimeVersion: 0, emissionKind: 0)
-!9 = !DICompileUnit(language: 12, file: !1, producer: "",
- isOptimized: false, flags: "", runtimeVersion: 0,
- splitDebugFilename: "", emissionKind: 0)
-!10 = !DICompileUnit(language: 12, file: !1)
+++ /dev/null
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
-; RUN: verify-uselistorder %s
-
-; CHECK: !named = !{!0, !1, !2, !3, !4}
-!named = !{!0, !1, !2, !3, !4}
-
-; CHECK: !0 = !DIExpression()
-; CHECK-NEXT: !1 = !DIExpression(DW_OP_deref)
-; CHECK-NEXT: !2 = !DIExpression(DW_OP_plus, 3)
-; CHECK-NEXT: !3 = !DIExpression(DW_OP_bit_piece, 3, 7)
-; CHECK-NEXT: !4 = !DIExpression(DW_OP_deref, DW_OP_plus, 3, DW_OP_bit_piece, 3, 7)
-!0 = !DIExpression()
-!1 = !DIExpression(DW_OP_deref)
-!2 = !DIExpression(DW_OP_plus, 3)
-!3 = !DIExpression(DW_OP_bit_piece, 3, 7)
-!4 = !DIExpression(DW_OP_deref, DW_OP_plus, 3, DW_OP_bit_piece, 3, 7)
+++ /dev/null
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
-; RUN: verify-uselistorder %s
-
-; Spot-check that metadata string fields are correctly escaped.
-
-!named = !{!0}
-
-; CHECK: !0 = !DIFile(filename: "\00\01\02\80\81\82\FD\FE\FF", directory: "/dir")
-!0 = !DIFile(filename: "\00\01\02\80\81\82\FD\FE\FF", directory: "/dir")
+++ /dev/null
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
-; RUN: verify-uselistorder %s
-
-@foo = global i32 0
-
-; CHECK: !named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9}
-!named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9}
-
-!0 = !DIFile(filename: "scope.h", directory: "/path/to/dir")
-!1 = distinct !{}
-!2 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
-!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!4 = distinct !{}
-
-; CHECK: !5 = !DIGlobalVariable(name: "foo", linkageName: "foo", scope: !0, file: !2, line: 7, type: !3, isLocal: true, isDefinition: false, variable: i32* @foo)
-!5 = !DIGlobalVariable(name: "foo", linkageName: "foo", scope: !0,
- file: !2, line: 7, type: !3, isLocal: true,
- isDefinition: false, variable: i32* @foo)
-
-; CHECK: !6 = !DIGlobalVariable(name: "foo", scope: !0, isLocal: false, isDefinition: true)
-!6 = !DIGlobalVariable(name: "foo", scope: !0)
-
-!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "Class", size: 8, align: 8)
-!8 = !DIDerivedType(tag: DW_TAG_member, name: "mem", flags: DIFlagStaticMember, scope: !7, baseType: !3)
-
-; CHECK: !9 = !DIGlobalVariable(name: "mem", scope: !0, isLocal: false, isDefinition: true, declaration: !8)
-!9 = !DIGlobalVariable(name: "mem", scope: !0, declaration: !8)
+++ /dev/null
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
-; RUN: verify-uselistorder %s
-
-; CHECK: !named = !{!0, !1, !2, !3, !3}
-!named = !{!0, !1, !2, !3, !4}
-
-; CHECK: !0 = !DISubprogram({{.*}})
-; CHECK-NEXT: !1 = !DICompositeType({{.*}})
-!0 = !DISubprogram(name: "foo")
-!1 = !DICompositeType(tag: DW_TAG_structure_type, name: "Class", size: 32, align: 32)
-
-; CHECK-NEXT: !2 = !DIImportedEntity(tag: DW_TAG_imported_module, name: "foo", scope: !0, entity: !1, line: 7)
-!2 = !DIImportedEntity(tag: DW_TAG_imported_module, name: "foo", scope: !0,
- entity: !1, line: 7)
-
-; CHECK-NEXT: !3 = !DIImportedEntity(tag: DW_TAG_imported_module, scope: !0)
-!3 = !DIImportedEntity(tag: DW_TAG_imported_module, scope: !0)
-!4 = !DIImportedEntity(tag: DW_TAG_imported_module, name: "", scope: !0, entity: null,
- line: 0)
-
+++ /dev/null
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
-; RUN: verify-uselistorder %s
-
-; CHECK: !named = !{!0, !1, !2, !3, !4, !4, !5, !6, !7, !7}
-!named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9}
-
-!0 = distinct !{}
-!1 = !DISubprogram(name: "foo", scope: !2)
-!2 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
-
-; CHECK: !3 = !DILexicalBlock(scope: !1, file: !2, line: 7, column: 35)
-!3 = !DILexicalBlock(scope: !1, file: !2, line: 7, column: 35)
-
-; CHECK: !4 = !DILexicalBlock(scope: !1)
-!4 = !DILexicalBlock(scope: !1)
-!5 = !DILexicalBlock(scope: !1, file: null, line: 0, column: 0)
-
-; CHECK: !5 = !DILexicalBlockFile(scope: !3, file: !2, discriminator: 0)
-; CHECK: !6 = !DILexicalBlockFile(scope: !3, file: !2, discriminator: 1)
-!6 = !DILexicalBlockFile(scope: !3, file: !2, discriminator: 0)
-!7 = !DILexicalBlockFile(scope: !3, file: !2, discriminator: 1)
-
-; CHECK: !7 = !DILexicalBlockFile(scope: !3, discriminator: 7)
-!8 = !DILexicalBlockFile(scope: !3, discriminator: 7)
-!9 = !DILexicalBlockFile(scope: !3, file: null, discriminator: 7)
+++ /dev/null
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
-; RUN: verify-uselistorder %s
-
-@foo = global i32 0
-
-; CHECK: !named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8}
-!named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8}
-
-!0 = distinct !DISubprogram()
-!1 = distinct !{}
-!2 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
-!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!4 = !DILocation(scope: !0)
-
-; CHECK: !5 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "foo", arg: 3, scope: !0, file: !2, line: 7, type: !3, flags: DIFlagArtificial)
-; CHECK: !6 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "foo", scope: !0, file: !2, line: 7, type: !3, flags: DIFlagArtificial)
-!5 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "foo", arg: 3,
- scope: !0, file: !2, line: 7, type: !3,
- flags: DIFlagArtificial)
-!6 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "foo", scope: !0,
- file: !2, line: 7, type: !3, flags: DIFlagArtificial)
-
-; CHECK: !7 = !DILocalVariable(tag: DW_TAG_arg_variable, arg: 0, scope: !0)
-; CHECK: !8 = !DILocalVariable(tag: DW_TAG_auto_variable, scope: !0)
-!7 = !DILocalVariable(tag: DW_TAG_arg_variable, scope: !0)
-!8 = !DILocalVariable(tag: DW_TAG_auto_variable, scope: !0)
+++ /dev/null
-; RUN: llvm-as < %s | llvm-dis | FileCheck %s
-; RUN: verify-uselistorder %s
-
-; CHECK: !named = !{!0, !1, !1, !2, !2, !3, !3, !4}
-!named = !{!0, !1, !2, !3, !4, !5, !6, !7}
-
-; CHECK: !0 = !DISubprogram(
-!0 = !DISubprogram()
-
-; CHECK-NEXT: !1 = !DILocation(line: 3, column: 7, scope: !0)
-!1 = !DILocation(line: 3, column: 7, scope: !0)
-!2 = !DILocation(scope: !0, column: 7, line: 3)
-
-; CHECK-NEXT: !2 = !DILocation(line: 3, column: 7, scope: !0, inlinedAt: !1)
-!3 = !DILocation(scope: !0, inlinedAt: !1, column: 7, line: 3)
-!4 = !DILocation(column: 7, line: 3, scope: !0, inlinedAt: !1)
-
-; CHECK-NEXT: !3 = !DILocation(line: 0, scope: !0)
-!5 = !DILocation(scope: !0)
-!6 = !DILocation(scope: !0, column: 0, line: 0)
-
-; CHECK-NEXT: !4 = !DILocation(line: 4294967295, column: 65535, scope: !0)
-!7 = !DILocation(line: 4294967295, column: 65535, scope: !0)
+++ /dev/null
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
-; RUN: verify-uselistorder %s
-
-; CHECK: !named = !{!0, !1, !2, !3, !4, !4}
-!named = !{!0, !1, !2, !3, !4, !5}
-
-!0 = !DIFile(filename: "file.cpp", directory: "/path/to/dir")
-!1 = distinct !{}
-!2 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
-
-; CHECK: !3 = !DINamespace(name: "Namespace", scope: !0, file: !2, line: 7)
-!3 = !DINamespace(name: "Namespace", scope: !0, file: !2, line: 7)
-
-; CHECK: !4 = !DINamespace(scope: !0)
-!4 = !DINamespace(name: "", scope: !0, file: null, line: 0)
-!5 = !DINamespace(scope: !0)
+++ /dev/null
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
-; RUN: verify-uselistorder %s
-
-; CHECK: !named = !{!0, !1, !2, !3, !4, !4}
-!named = !{!0, !1, !2, !3, !4, !5}
-
-!0 = distinct !{}
-!1 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
-!2 = !DICompositeType(tag: DW_TAG_structure_type, name: "Object")
-
-; CHECK: !2 = !DICompositeType({{.*}})
-; CHECK-NEXT: !3 = !DIObjCProperty(name: "foo", file: !1, line: 7, setter: "setFoo", getter: "getFoo", attributes: 7, type: !2)
-!3 = !DIObjCProperty(name: "foo", file: !1, line: 7, setter: "setFoo",
- getter: "getFoo", attributes: 7, type: !2)
-
-; CHECK-NEXT: !4 = !DIObjCProperty()
-!4 = !DIObjCProperty(name: "", file: null, line: 0, setter: "", getter: "",
- attributes: 0, type: null)
-!5 = !DIObjCProperty()
+++ /dev/null
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
-; RUN: verify-uselistorder %s
-
-declare void @_Z3foov()
-
-; CHECK: !named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9}
-!named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9}
-
-!0 = !{null}
-!1 = distinct !DICompositeType(tag: DW_TAG_structure_type)
-!2 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
-!3 = !DISubroutineType(types: !0)
-!4 = distinct !DICompositeType(tag: DW_TAG_structure_type)
-!5 = distinct !{}
-!6 = distinct !DISubprogram(isDefinition: false)
-!7 = distinct !{}
-
-; CHECK: !8 = !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1, file: !2, line: 7, type: !3, isLocal: true, isDefinition: false, scopeLine: 8, containingType: !4, virtuality: DW_VIRTUALITY_pure_virtual, virtualIndex: 10, flags: DIFlagPrototyped, isOptimized: true, function: void ()* @_Z3foov, templateParams: !5, declaration: !6, variables: !7)
-!8 = !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1,
- file: !2, line: 7, type: !3, isLocal: true,
- isDefinition: false, scopeLine: 8, containingType: !4,
- virtuality: DW_VIRTUALITY_pure_virtual, virtualIndex: 10,
- flags: DIFlagPrototyped, isOptimized: true, function: void ()* @_Z3foov,
- templateParams: !5, declaration: !6, variables: !7)
-
-; CHECK: !9 = !DISubprogram(scope: null, isLocal: false, isDefinition: true, isOptimized: false)
-!9 = !DISubprogram()
-
+++ /dev/null
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
-; RUN: verify-uselistorder %s
-
-; CHECK: !named = !{!0, !0, !1, !2}
-!named = !{!0, !1, !2, !3}
-
-; CHECK: !0 = !DISubrange(count: -1)
-; CHECK-NEXT: !1 = !DISubrange(count: -1, lowerBound: 4)
-; CHECK-NEXT: !2 = !DISubrange(count: -1, lowerBound: -5)
-!0 = !DISubrange(count: -1)
-!1 = !DISubrange(count: -1, lowerBound: 0)
-
-!2 = !DISubrange(count: -1, lowerBound: 4)
-!3 = !DISubrange(count: -1, lowerBound: -5)
+++ /dev/null
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
-; RUN: verify-uselistorder %s
-
-; CHECK: !named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8}
-!named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8}
-
-!0 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!1 = !{null}
-!2 = !{null, !0}
-!3 = !{!0, !0, !0}
-
-
-; CHECK: !4 = !DISubroutineType(types: !1)
-; CHECK: !5 = !DISubroutineType(types: !2)
-; CHECK: !6 = !DISubroutineType(types: !3)
-; CHECK: !7 = !DISubroutineType(flags: DIFlagLValueReference, types: !3)
-!4 = !DISubroutineType(types: !1)
-!5 = !DISubroutineType(types: !2)
-!6 = !DISubroutineType(types: !3)
-!7 = !DISubroutineType(flags: DIFlagLValueReference, types: !3)
-
-; CHECK: !8 = !DISubroutineType(types: null)
-!8 = !DISubroutineType(types: null)
+++ /dev/null
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
-; RUN: verify-uselistorder %s
-
-; CHECK: !named = !{!0, !1, !2, !3, !3, !4, !5, !5, !6}
-!named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8}
-
-!0 = distinct !{}
-!1 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-; CHECK: !1 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-
-; CHECK-NEXT: !2 = !DITemplateTypeParameter(name: "Ty", type: !1)
-; CHECK-NEXT: !3 = !DITemplateTypeParameter(type: !1)
-!2 = !DITemplateTypeParameter(name: "Ty", type: !1)
-!3 = !DITemplateTypeParameter(type: !1)
-!4 = !DITemplateTypeParameter(name: "", type: !1)
-
-; CHECK-NEXT: !4 = !DITemplateValueParameter(name: "V", type: !1, value: i32 7)
-; CHECK-NEXT: !5 = !DITemplateValueParameter(type: !1, value: i32 7)
-; CHECK-NEXT: !6 = !DITemplateValueParameter(tag: DW_TAG_GNU_template_template_param, name: "param", type: !1, value: !"template")
-!5 = !DITemplateValueParameter(name: "V", type: !1, value: i32 7)
-!6 = !DITemplateValueParameter(type: !1, value: i32 7)
-!7 = !DITemplateValueParameter(tag: DW_TAG_template_value_parameter,
- name: "", type: !1, value: i32 7)
-!8 = !DITemplateValueParameter(tag: DW_TAG_GNU_template_template_param, name: "param", type: !1, value: !"template")
+++ /dev/null
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
-; RUN: verify-uselistorder %s
-
-; CHECK: !named = !{!0, !1, !2}
-!named = !{!0, !1, !2}
-
-; CHECK: !0 = !DIBasicType(name: "name", size: 18446744073709551615, align: 18446744073709551614, encoding: DW_ATE_unsigned_char)
-; CHECK-NEXT: !1 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !0, size: 18446744073709551615, align: 18446744073709551614, offset: 18446744073709551613)
-; CHECK-NEXT: !2 = !DICompositeType(tag: DW_TAG_array_type, baseType: !0, size: 18446744073709551615, align: 18446744073709551614, offset: 18446744073709551613)
-!0 = !DIBasicType(tag: DW_TAG_base_type, name: "name", size: 18446744073709551615, align: 18446744073709551614, encoding: DW_ATE_unsigned_char)
-!1 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !0, size: 18446744073709551615, align: 18446744073709551614, offset: 18446744073709551613)
-!2 = !DICompositeType(tag: DW_TAG_array_type, baseType: !0, size: 18446744073709551615, align: 18446744073709551614, offset: 18446744073709551613)