1 ;; Check that an unknown --target-abi is ignored and the triple-implied ABI is
3 ; RUN: llc --mtriple=loongarch32-linux-gnu --target-abi=foo --mattr=+d < %s 2>&1 \
4 ; RUN: | FileCheck %s --check-prefixes=ILP32D,UNKNOWN
5 ; RUN: llc --mtriple=loongarch64-linux-gnu --target-abi=foo --mattr=+d < %s 2>&1 \
6 ; RUN: | FileCheck %s --check-prefixes=LP64D,UNKNOWN
8 ; UNKNOWN: 'foo' is not a recognized ABI for this target, ignoring and using triple-implied ABI
10 ;; Check that --target-abi takes precedence over triple-supplied ABI modifiers.
11 ; RUN: llc --mtriple=loongarch32-linux-gnusf --target-abi=ilp32d --mattr=+d < %s 2>&1 \
12 ; RUN: | FileCheck %s --check-prefixes=ILP32D,CONFLICT-ILP32D
13 ; RUN: llc --mtriple=loongarch64-linux-gnusf --target-abi=lp64d --mattr=+d < %s 2>&1 \
14 ; RUN: | FileCheck %s --check-prefixes=LP64D,CONFLICT-LP64D
16 ; CONFLICT-ILP32D: warning: triple-implied ABI conflicts with provided target-abi 'ilp32d', using target-abi
17 ; CONFLICT-LP64D: warning: triple-implied ABI conflicts with provided target-abi 'lp64d', using target-abi
19 ;; Check that no warning is reported when there is no environment component in
20 ;; triple-supplied ABI modifiers and --target-abi is used.
21 ; RUN: llc --mtriple=loongarch64-linux --target-abi=lp64d --mattr=+d < %s 2>&1 \
22 ; RUN: | FileCheck %s --check-prefixes=LP64D,NO-WARNING
24 ; NO-WARNING-NOT: warning: triple-implied ABI conflicts with provided target-abi 'lp64d', using target-abi
26 ;; Check that ILP32-on-LA64 and LP64-on-LA32 combinations are handled properly.
27 ; RUN: llc --mtriple=loongarch64 --target-abi=ilp32d --mattr=+d < %s 2>&1 \
28 ; RUN: | FileCheck %s --check-prefixes=LP64D,32ON64
29 ; RUN: llc --mtriple=loongarch32 --target-abi=lp64d --mattr=+d < %s 2>&1 \
30 ; RUN: | FileCheck %s --check-prefixes=ILP32D,64ON32
32 ; 32ON64: 32-bit ABIs are not supported for 64-bit targets, ignoring target-abi and using triple-implied ABI
33 ; 64ON32: 64-bit ABIs are not supported for 32-bit targets, ignoring target-abi and using triple-implied ABI
35 define float @f(float %a) {
38 ; ILP32D-NEXT: addi.w $a0, $zero, 1
39 ; ILP32D-NEXT: movgr2fr.w $fa1, $a0
40 ; ILP32D-NEXT: ffint.s.w $fa1, $fa1
41 ; ILP32D-NEXT: fadd.s $fa0, $fa0, $fa1
46 ; LP64D-NEXT: addi.w $a0, $zero, 1
47 ; LP64D-NEXT: movgr2fr.w $fa1, $a0
48 ; LP64D-NEXT: ffint.s.w $fa1, $fa1
49 ; LP64D-NEXT: fadd.s $fa0, $fa0, $fa1
51 %1 = fadd float %a, 1.0
55 define double @g(double %a) {
58 ; ILP32D-NEXT: addi.w $a0, $zero, 1
59 ; ILP32D-NEXT: movgr2fr.w $fa1, $a0
60 ; ILP32D-NEXT: ffint.s.w $fa1, $fa1
61 ; ILP32D-NEXT: fcvt.d.s $fa1, $fa1
62 ; ILP32D-NEXT: fadd.d $fa0, $fa0, $fa1
67 ; LP64D-NEXT: addi.d $a0, $zero, 1
68 ; LP64D-NEXT: movgr2fr.d $fa1, $a0
69 ; LP64D-NEXT: ffint.d.l $fa1, $fa1
70 ; LP64D-NEXT: fadd.d $fa0, $fa0, $fa1
72 %1 = fadd double %a, 1.0