File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ ; RUN: llc -filetype=obj -mtriple=riscv64 %s -o %t
2
+ ; RUN: llvm-objdump -dr -M no-aliases --mattr=+c %t | FileCheck %s
3
+
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.
7
+
8
+ declare dso_local i32 @ext (i32 )
9
+
10
+ ; CHECK-LABEL: <f>:
11
+ ; CHECK-NEXT: c.li a0, 31
12
+ ; CHECK-NEXT: auipc t1, 0
13
+ ; CHECK-NEXT: R_RISCV_CALL_PLT ext
14
+ ; CHECK-NEXT: jalr zero, 0(t1)
15
+ define dso_local i32 @f () #0 {
16
+ entry:
17
+ %r = tail call i32 @ext (i32 31 )
18
+ ret i32 %r
19
+ }
20
+
21
+ ; CHECK-LABEL: <g>:
22
+ ; CHECK-NEXT: addi a0, zero, 31
23
+ ; CHECK-NEXT: auipc t1, 0
24
+ ; CHECK-NEXT: R_RISCV_CALL_PLT ext
25
+ ; CHECK-NEXT: jalr zero, 0(t1)
26
+ define dso_local i32 @g () #1 {
27
+ entry:
28
+ %r = tail call i32 @ext (i32 31 )
29
+ ret i32 %r
30
+ }
31
+
32
+ attributes #0 = { nounwind "target-features" ="+c,+relax" }
33
+ attributes #1 = { nounwind "target-features" ="-c,-relax" }
You can’t perform that action at this time.
0 commit comments