xref: /llvm-project/llvm/test/CodeGen/RISCV/dso_local_equivalent.ll (revision cdb9a0c086a5b7e0972957be91f5864647b05038)
1; RUN: llc -mtriple=riscv64 < %s | FileCheck %s --match-full-lines
2; RUN: llc -mtriple=riscv32 < %s | FileCheck %s --match-full-lines
3
4declare void @extern_func()
5
6; CHECK-LABEL: const:
7; CHECK-NEXT:    .word   extern_func@PLT-const
8
9;; Note that for riscv32, the ptrtoint will actually upcast the ptr it to an
10;; oversized 64-bit pointer that eventually gets truncated. This isn't needed
11;; for riscv32, but this unifies the RV64 and RV32 test cases.
12@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)
13