Matt Davis | 5047227 | 2018-03-08 19:31:37 +0000 | [diff] [blame] | 1 | ; RUN: opt -verify -disable-output <%s 2>&1 | FileCheck %s |
| 2 | ; |
| 3 | ; This test creates an invalid vector by defining multiple elements for the |
| 4 | ; vector's DICompositeType definition. A vector should only have one element |
| 5 | ; in its DICompositeType 'elements' array. |
| 6 | ; |
| 7 | ; CHECK: invalid vector |
| 8 | |
| 9 | @f.foo = private unnamed_addr constant <6 x float> zeroinitializer, align 32 |
| 10 | |
| 11 | define void @f() { |
| 12 | %1 = alloca <6 x float>, align 32 |
| 13 | call void @llvm.dbg.declare(metadata <6 x float>* %1, metadata !10, metadata !DIExpression()), !dbg !18 |
| 14 | ret void |
| 15 | } |
| 16 | |
| 17 | declare void @llvm.dbg.declare(metadata, metadata, metadata) |
| 18 | |
| 19 | !llvm.dbg.cu = !{!0} |
| 20 | !llvm.module.flags = !{!3, !4} |
| 21 | |
| 22 | !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) |
| 23 | !1 = !DIFile(filename: "test.c", directory: "/dbg/info") |
| 24 | !2 = !{} |
| 25 | !3 = !{i32 2, !"Dwarf Version", i32 4} |
| 26 | !4 = !{i32 2, !"Debug Info Version", i32 3} |
Shiva Chen | 2c86455 | 2018-05-09 02:40:45 +0000 | [diff] [blame^] | 27 | !7 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 3, type: !8, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2) |
Matt Davis | 5047227 | 2018-03-08 19:31:37 +0000 | [diff] [blame] | 28 | !8 = !DISubroutineType(types: !9) |
| 29 | !9 = !{null} |
| 30 | !10 = !DILocalVariable(name: "foo", scope: !7, file: !1, line: 4, type: !12) |
| 31 | !12 = !DICompositeType(tag: DW_TAG_array_type, baseType: !13, size: 256, flags: DIFlagVector, elements: !14) |
| 32 | !13 = !DIBasicType(name: "float", size: 32, encoding: DW_ATE_float) |
| 33 | !14 = !{!15, !19} |
| 34 | !15 = !DISubrange(count: 6) |
| 35 | !18 = !DILocation(line: 4, column: 48, scope: !7) |
| 36 | !19 = !DISubrange(count: 42) |