1 ; RUN: llc -filetype=obj -mtriple=riscv64 %s -o %t
2 ; RUN: llvm-objdump -dr -M no-aliases --mattr=+c %t | FileCheck %s
4 ;; Functions may have more features than the base triple; code generation and
5 ;; instruction selection may be performed based on this information. This test
6 ;; makes sure that the MC layer uses the target-features of the function.
8 declare dso_local i32 @ext(i32)
11 ; CHECK-NEXT: c.li a0, 0x1f
12 ; CHECK-NEXT: auipc t1, 0x0
13 ; CHECK-NEXT: R_RISCV_CALL_PLT ext
14 ; CHECK-NEXT: R_RISCV_RELAX *ABS*
15 ; CHECK-NEXT: jalr zero, 0x0(t1)
16 define dso_local i32 @f() #0 {
18 %r = tail call i32 @ext(i32 31)
23 ; CHECK-NEXT: addi a0, zero, 0x1f
24 ; CHECK-NEXT: auipc t1, 0x0
25 ; CHECK-NEXT: R_RISCV_CALL_PLT ext
26 ; CHECK-NEXT: jalr zero, 0x0(t1)
27 define dso_local i32 @g() #1 {
29 %r = tail call i32 @ext(i32 31)
33 attributes #0 = { nounwind "target-features"="+c,+relax" }
34 attributes #1 = { nounwind "target-features"="-c,-relax" }