|
| 1 | +; RUN: llc -mtriple=aarch64 < %s | FileCheck %s --match-full-lines |
| 2 | + |
| 3 | +declare void @extern_func() |
| 4 | + |
| 5 | +; CHECK-LABEL: const: |
| 6 | +; CHECK-NEXT: .word %pltpcrel(extern_func) |
| 7 | + |
| 8 | +@const = dso_local constant i32 trunc (i64 sub (i64 ptrtoint (ptr dso_local_equivalent @extern_func to i64), i64 ptrtoint (ptr @const to i64)) to i32) |
| 9 | + |
| 10 | +@_ZTV1B = dso_local constant { [7 x i32] } { [7 x i32] [ |
| 11 | + i32 0, |
| 12 | + i32 0, |
| 13 | + i32 trunc (i64 sub (i64 ptrtoint (ptr dso_local_equivalent @f0 to i64), i64 ptrtoint (ptr getelementptr inbounds ({ [7 x i32] }, ptr @_ZTV1B, i32 0, i32 0, i32 2) to i64)) to i32), |
| 14 | + i32 trunc (i64 sub (i64 ptrtoint (ptr dso_local_equivalent @f1 to i64), i64 ptrtoint (ptr getelementptr inbounds ({ [7 x i32] }, ptr @_ZTV1B, i32 0, i32 0, i32 2) to i64)) to i32), |
| 15 | + i32 trunc (i64 sub (i64 ptrtoint (ptr dso_local_equivalent @f2 to i64), i64 ptrtoint (ptr getelementptr inbounds ({ [7 x i32] }, ptr @_ZTV1B, i32 0, i32 0, i32 2) to i64)) to i32), |
| 16 | + i32 trunc (i64 sub (i64 ptrtoint (ptr dso_local_equivalent @f3 to i64), i64 ptrtoint (ptr getelementptr inbounds ({ [7 x i32] }, ptr @_ZTV1B, i32 0, i32 0, i32 2) to i64)) to i32), |
| 17 | + i32 trunc (i64 sub (i64 ptrtoint (ptr dso_local_equivalent @f4 to i64), i64 ptrtoint (ptr getelementptr inbounds ({ [7 x i32] }, ptr @_ZTV1B, i32 0, i32 0, i32 2) to i64)) to i32) |
| 18 | +] }, align 4 |
| 19 | + |
| 20 | +; CHECK-LABEL: _ZTV1B: |
| 21 | +; CHECK-NEXT: .word 0 // 0x0 |
| 22 | +; CHECK-NEXT: .word 0 // 0x0 |
| 23 | +; CHECK-NEXT: .word %pltpcrel(f0) |
| 24 | +; CHECK-NEXT: .word %pltpcrel(f1+4) |
| 25 | +; CHECK-NEXT: .word %pltpcrel(f2+8) |
| 26 | +; CHECK-NEXT: .word %pltpcrel(f3+12) |
| 27 | +; CHECK-NEXT: .word %pltpcrel(f4+16) |
| 28 | +; CHECK-NEXT: .size _ZTV1B, 28 |
| 29 | +declare void @f0() |
| 30 | +declare void @f1() |
| 31 | +define dso_local void @f2() { |
| 32 | + ret void |
| 33 | +} |
| 34 | +define void @f3() { |
| 35 | + ret void |
| 36 | +} |
| 37 | +define hidden void @f4() { |
| 38 | + ret void |
| 39 | +} |
0 commit comments