brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 0706b0e Raw
35 lines · plain
1; RUN: llc -filetype=obj -mtriple=riscv64 %s -o %t2; RUN: llvm-objdump -dr -M no-aliases --mattr=+c %t | FileCheck %s3 4;; Functions may have more features than the base triple; code generation and5;; instruction selection may be performed based on this information. This test6;; makes sure that the MC layer uses the target-features of the function.7 8declare dso_local i32 @ext(i32)9 10; CHECK-LABEL: <f>:11; CHECK-NEXT:    c.li a0, 0x1f12; CHECK-NEXT:    auipc t1, 0x013; CHECK-NEXT:    R_RISCV_CALL_PLT     ext14; CHECK-NEXT:    R_RISCV_RELAX *ABS*15; CHECK-NEXT:    jalr zero, 0x0(t1)16define dso_local i32 @f() #0 {17entry:18  %r = tail call i32 @ext(i32 31)19  ret i32 %r20}21 22; CHECK-LABEL: <g>:23; CHECK-NEXT:    addi a0, zero, 0x1f24; CHECK-NEXT:    auipc t1, 0x025; CHECK-NEXT:    R_RISCV_CALL_PLT     ext26; CHECK-NEXT:    jalr zero, 0x0(t1)27define dso_local i32 @g() #1 {28entry:29  %r = tail call i32 @ext(i32 31)30  ret i32 %r31}32 33attributes #0 = { nounwind "target-features"="+c,+relax" }34attributes #1 = { nounwind "target-features"="-c,-relax" }35