Krzysztof Parzyszek | 1df7059 | 2018-08-08 17:00:09 +0000 | [diff] [blame] | 1 | ; RUN: not llc -march=hexagon < %s 2>&1 | FileCheck %s |
| 2 | |
| 3 | ; Check that the misaligned load is diagnosed. |
| 4 | ; CHECK: LLVM ERROR: Misaligned constant address: 0x00012345 has alignment 1, but the memory access requires 4, at misaligned-const-load.c:2:10 |
| 5 | |
| 6 | target triple = "hexagon" |
| 7 | |
| 8 | define i32 @bad_load() #0 !dbg !10 { |
| 9 | entry: |
| 10 | %0 = load i32, i32* inttoptr (i32 74565 to i32*), align 4, !dbg !13, !tbaa !14 |
| 11 | ret i32 %0, !dbg !18 |
| 12 | } |
| 13 | |
| 14 | attributes #0 = { norecurse nounwind readonly "target-cpu"="hexagonv60" } |
| 15 | |
| 16 | !llvm.dbg.cu = !{!0} |
| 17 | !llvm.module.flags = !{!6, !7, !8} |
| 18 | !llvm.ident = !{!9} |
| 19 | |
James Y Knight | 693d39d | 2019-01-15 16:18:52 +0000 | [diff] [blame] | 20 | !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 8.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3) |
Krzysztof Parzyszek | 1df7059 | 2018-08-08 17:00:09 +0000 | [diff] [blame] | 21 | !1 = !DIFile(filename: "misaligned-const-load.c", directory: "/test") |
| 22 | !2 = !{} |
| 23 | !3 = !{!4} |
| 24 | !4 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !5, size: 32) |
| 25 | !5 = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned) |
| 26 | !6 = !{i32 2, !"Dwarf Version", i32 4} |
| 27 | !7 = !{i32 2, !"Debug Info Version", i32 3} |
| 28 | !8 = !{i32 1, !"wchar_size", i32 4} |
James Y Knight | 693d39d | 2019-01-15 16:18:52 +0000 | [diff] [blame] | 29 | !9 = !{!"clang version 8.0.0"} |
Krzysztof Parzyszek | 1df7059 | 2018-08-08 17:00:09 +0000 | [diff] [blame] | 30 | !10 = distinct !DISubprogram(name: "bad_load", scope: !1, file: !1, line: 1, type: !11, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: true, unit: !0, retainedNodes: !2) |
| 31 | !11 = !DISubroutineType(types: !12) |
| 32 | !12 = !{!5} |
| 33 | !13 = !DILocation(line: 2, column: 10, scope: !10) |
| 34 | !14 = !{!15, !15, i64 0} |
| 35 | !15 = !{!"int", !16, i64 0} |
| 36 | !16 = !{!"omnipotent char", !17, i64 0} |
| 37 | !17 = !{!"Simple C/C++ TBAA"} |
| 38 | !18 = !DILocation(line: 2, column: 3, scope: !10) |