Matthias Braun | d2fc0d4 | 2016-10-03 21:58:20 +0000 | [diff] [blame] | 1 | ; RUN: llc -mtriple=hexagon-- -mcpu=hexagonv5 -relocation-model=pic < %s | FileCheck %s |
Krzysztof Parzyszek | 21dc8bd | 2015-12-18 20:19:30 +0000 | [diff] [blame] | 2 | |
Krzysztof Parzyszek | a72fad9 | 2017-02-10 15:33:13 +0000 | [diff] [blame] | 3 | ; CHECK-DAG: r{{[0-9]+}} = add({{pc|PC}},##_GLOBAL_OFFSET_TABLE_@PCREL) |
| 4 | ; CHECK-DAG: r{{[0-9]+}} = add({{pc|PC}},##x@PCREL) |
| 5 | ; CHECK: r{{[0-9]+}} = memw(r{{[0-9]+}}+##bar@GOT) |
Krzysztof Parzyszek | 21dc8bd | 2015-12-18 20:19:30 +0000 | [diff] [blame] | 6 | |
| 7 | @x = internal global i32 9, align 4 |
| 8 | @bar = external global i32* |
| 9 | |
| 10 | define i32 @foo(i32 %y) nounwind { |
| 11 | entry: |
| 12 | store i32* @x, i32** @bar, align 4, !tbaa !0 |
| 13 | %0 = load i32, i32* @x, align 4, !tbaa !3 |
| 14 | %add = add nsw i32 %0, %y |
| 15 | ret i32 %add |
| 16 | } |
| 17 | |
| 18 | !0 = !{!"any pointer", !1} |
| 19 | !1 = !{!"omnipotent char", !2} |
| 20 | !2 = !{!"Simple C/C++ TBAA"} |
| 21 | !3 = !{!"int", !1} |