1 ; RUN: llc -mtriple arm-unknown -verify-machineinstrs -global-isel -global-isel-abort=2 -pass-remarks-missed='gisel*' %s -o - 2>&1 | FileCheck %s -check-prefixes=CHECK
2 ; RUN: llc -mtriple arm-unknown -verify-machineinstrs -global-isel -global-isel-abort=2 -pass-remarks-missed='gisel*' -relocation-model=pic %s -o - 2>&1 | FileCheck %s -check-prefixes=PIC
3 ; RUN: llc -mtriple arm-unknown -verify-machineinstrs -global-isel -global-isel-abort=2 -pass-remarks-missed='gisel*' -relocation-model=ropi %s -o - 2>&1 | FileCheck %s -check-prefixes=ROPI
4 ; RUN: llc -mtriple arm-unknown -verify-machineinstrs -global-isel -global-isel-abort=2 -pass-remarks-missed='gisel*' -relocation-model=rwpi %s -o - 2>&1 | FileCheck %s -check-prefixes=RWPI
5 ; RUN: llc -mtriple arm-unknown -verify-machineinstrs -global-isel -global-isel-abort=2 -pass-remarks-missed='gisel*' -relocation-model=ropi-rwpi %s -o - 2>&1 | FileCheck %s -check-prefixes=ROPI-RWPI
7 ; This file checks that we use the fallback path for things that are known to
8 ; be unsupported on the ARM target. It should progressively shrink in size.
10 define <4 x i32> @test_int_vectors(<4 x i32> %a, <4 x i32> %b) {
11 ; CHECK: remark: {{.*}} unable to lower arguments: <4 x i32> (<4 x i32>, <4 x i32>)*
12 ; CHECK-LABEL: warning: Instruction selection used fallback path for test_int_vectors
13 %res = add <4 x i32> %a, %b
17 define <4 x float> @test_float_vectors(<4 x float> %a, <4 x float> %b) {
18 ; CHECK: remark: {{.*}} unable to lower arguments: <4 x float> (<4 x float>, <4 x float>)*
19 ; CHECK-LABEL: warning: Instruction selection used fallback path for test_float_vectors
20 %res = fadd <4 x float> %a, %b
24 define i64 @test_i64(i64 %a, i64 %b) {
25 ; CHECK: remark: {{.*}} unable to lower arguments: i64 (i64, i64)*
26 ; CHECK-LABEL: warning: Instruction selection used fallback path for test_i64
31 define i128 @test_i128(i128 %a, i128 %b) {
32 ; CHECK: remark: {{.*}} unable to lower arguments: i128 (i128, i128)*
33 ; CHECK-LABEL: warning: Instruction selection used fallback path for test_i128
34 %res = add i128 %a, %b
38 define i17 @test_funny_ints(i17 %a, i17 %b) {
39 ; CHECK: remark: {{.*}} unable to lower arguments: i17 (i17, i17)*
40 ; CHECK-LABEL: warning: Instruction selection used fallback path for test_funny_ints
45 define half @test_half(half %a, half %b) {
46 ; CHECK: remark: {{.*}} unable to lower arguments: half (half, half)* (in function: test_half)
47 ; CHECK-LABEL: warning: Instruction selection used fallback path for test_half
48 %res = fadd half %a, %b
52 declare [16 x i32] @ret_demotion_target()
54 define [16 x i32] @test_ret_demotion() {
55 ; CHECK: remark: {{.*}} unable to translate instruction: call{{.*}} @ret_demotion_target
56 ; CHECK-LABEL: warning: Instruction selection used fallback path for test_ret_demotion
57 %res = call [16 x i32] @ret_demotion_target()
61 %large.struct = type { i32, i32, i32, i32, i32} ; Doesn't fit in R0-R3
63 declare %large.struct @large_struct_return_target()
65 define %large.struct @test_large_struct_return() {
66 ; CHECK: remark: {{.*}} unable to translate instruction: call{{.*}} @large_struct_return_target
67 ; CHECK-LABEL: warning: Instruction selection used fallback path for test_large_struct_return
68 %r = call %large.struct @large_struct_return_target()
72 %mixed.struct = type {i32*, float, i32}
74 define %mixed.struct @test_mixed_struct(%mixed.struct %x) {
75 ; CHECK: remark: {{.*}} unable to lower arguments: %mixed.struct (%mixed.struct)*
76 ; CHECK-LABEL: warning: Instruction selection used fallback path for test_mixed_struct
80 define void @test_vararg_definition(i32 %a, ...) {
81 ; CHECK: remark: {{.*}} unable to lower arguments: void (i32, ...)*
82 ; CHECK-LABEL: warning: Instruction selection used fallback path for test_vararg_definition
86 define i32 @test_thumb(i32 %a) #0 {
87 ; CHECK: remark: {{.*}} unable to lower arguments: i32 (i32)*
88 ; CHECK-LABEL: warning: Instruction selection used fallback path for test_thumb
92 @thread_local_global = thread_local global i32 42
94 define i32 @test_thread_local_global() {
95 ; CHECK: remark: {{.*}} cannot select: {{.*}} G_GLOBAL_VALUE
96 ; CHECK-LABEL: warning: Instruction selection used fallback path for test_thread_local_global
97 ; PIC: remark: {{.*}} cannot select: {{.*}} G_GLOBAL_VALUE
98 ; PIC-LABEL: warning: Instruction selection used fallback path for test_thread_local_global
99 ; ROPI: remark: {{.*}} cannot select: {{.*}} G_GLOBAL_VALUE
100 ; ROPI-LABEL: warning: Instruction selection used fallback path for test_thread_local_global
101 ; RWPI: remark: {{.*}} cannot select: {{.*}} G_GLOBAL_VALUE
102 ; RWPI-LABEL: warning: Instruction selection used fallback path for test_thread_local_global
103 ; ROPI-RWPI: remark: {{.*}} cannot select: {{.*}} G_GLOBAL_VALUE
104 ; ROPI-RWPI-LABEL: warning: Instruction selection used fallback path for test_thread_local_global
105 %v = load i32, i32* @thread_local_global
109 %byval.class = type { i32 }
111 define void @test_byval_arg(%byval.class* byval %x) {
112 ; CHECK: remark: {{.*}} unable to lower arguments: void (%byval.class*)*
113 ; CHECK-LABEL: warning: Instruction selection used fallback path for test_byval
117 define void @test_byval_param(%byval.class* %x) {
118 ; CHECK: remark: {{.*}} unable to translate instruction: call
119 ; CHECK-LABEL: warning: Instruction selection used fallback path for test_byval_param
120 call void @test_byval_arg(%byval.class* byval %x)
124 attributes #0 = { "target-features"="+thumb-mode" }