1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=aarch64_be-none-eabi -fast-isel=false < %s | FileCheck %s 2*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=aarch64_be-none-eabi -fast-isel=true < %s | FileCheck %s 3*9880d681SAndroid Build Coastguard Worker 4*9880d681SAndroid Build Coastguard Worker; Check narrow argument passing via stack - callee end 5*9880d681SAndroid Build Coastguard Workerdefine i32 @test_narrow_args_callee(i64 %x0, i64 %x1, i64 %x2, i64 %x3, i64 %x4, i64 %x5, i64 %x6, i64 %x7, i8 %c, i16 %s) #0 { 6*9880d681SAndroid Build Coastguard Workerentry: 7*9880d681SAndroid Build Coastguard Worker %conv = zext i8 %c to i32 8*9880d681SAndroid Build Coastguard Worker %conv1 = sext i16 %s to i32 9*9880d681SAndroid Build Coastguard Worker %add = add nsw i32 %conv1, %conv 10*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: test_narrow_args_callee: 11*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: ldrb w{{[0-9]}}, [sp, #7] 12*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: ldr{{s?}}h w{{[0-9]}}, [sp, #14] 13*9880d681SAndroid Build Coastguard Worker ret i32 %add 14*9880d681SAndroid Build Coastguard Worker} 15*9880d681SAndroid Build Coastguard Worker 16*9880d681SAndroid Build Coastguard Worker; Check narrow argument passing via stack - caller end 17*9880d681SAndroid Build Coastguard Workerdefine i32 @test_narrow_args_caller() #0 { 18*9880d681SAndroid Build Coastguard Workerentry: 19*9880d681SAndroid Build Coastguard Worker %call = tail call i32 @test_narrow_args_callee(i64 undef, i64 undef, i64 undef, i64 undef, i64 undef, i64 undef, i64 undef, i64 undef, i8 8, i16 9) 20*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: test_narrow_args_caller: 21*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: strh w{{[0-9]}}, [sp, #14] 22*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: strb w{{[0-9]}}, [sp, #7] 23*9880d681SAndroid Build Coastguard Worker ret i32 %call 24*9880d681SAndroid Build Coastguard Worker} 25*9880d681SAndroid Build Coastguard Worker 26*9880d681SAndroid Build Coastguard Workerdefine float @test_block_addr([8 x float], [1 x float] %in) { 27*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: test_block_addr: 28*9880d681SAndroid Build Coastguard Worker; CHECK: ldr s0, [sp] 29*9880d681SAndroid Build Coastguard Worker %val = extractvalue [1 x float] %in, 0 30*9880d681SAndroid Build Coastguard Worker ret float %val 31*9880d681SAndroid Build Coastguard Worker} 32*9880d681SAndroid Build Coastguard Worker 33*9880d681SAndroid Build Coastguard Workerdefine void @test_block_addr_callee() { 34*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: test_block_addr_callee: 35*9880d681SAndroid Build Coastguard Worker; CHECK: sub sp, sp, #32 36*9880d681SAndroid Build Coastguard Worker; CHECK: str {{[a-z0-9]+}}, [sp, #16] 37*9880d681SAndroid Build Coastguard Worker; CHECK: bl test_block_addr 38*9880d681SAndroid Build Coastguard Worker %val = insertvalue [1 x float] undef, float 0.0, 0 39*9880d681SAndroid Build Coastguard Worker call float @test_block_addr([8 x float] undef, [1 x float] %val) 40*9880d681SAndroid Build Coastguard Worker ret void 41*9880d681SAndroid Build Coastguard Worker} 42