2019-11-27 12:28:52 +08:00
|
|
|
// RUN: %clang_cc1 -triple armv7a--none-eabi -target-abi aapcs -mfloat-abi soft -fallow-half-arguments-and-returns -emit-llvm -o - -O2 %s | FileCheck %s --check-prefix=CHECK --check-prefix=SOFT
|
|
|
|
// RUN: %clang_cc1 -triple armv7a--none-eabi -target-abi aapcs -mfloat-abi hard -fallow-half-arguments-and-returns -emit-llvm -o - -O2 %s | FileCheck %s --check-prefix=CHECK --check-prefix=HARD
|
2020-06-09 16:52:01 +08:00
|
|
|
// RUN: %clang_cc1 -triple armv7a--none-eabi -target-abi aapcs -mfloat-abi soft -fnative-half-arguments-and-returns -emit-llvm -o - -O2 %s | FileCheck %s --check-prefix=CHECK --check-prefix=NATIVE
|
2015-09-03 20:40:58 +08:00
|
|
|
|
|
|
|
__fp16 g;
|
|
|
|
|
|
|
|
void t1(__fp16 a) { g = a; }
|
2022-01-16 17:53:11 +08:00
|
|
|
// SOFT: define{{.*}} void @t1(half noundef [[PARAM:%.*]])
|
|
|
|
// HARD: define{{.*}} arm_aapcs_vfpcc void @t1(half noundef [[PARAM:%.*]])
|
|
|
|
// NATIVE: define{{.*}} void @t1(half noundef [[PARAM:%.*]])
|
2020-06-09 16:52:01 +08:00
|
|
|
// CHECK: store half [[PARAM]], half* @g
|
2015-09-03 20:40:58 +08:00
|
|
|
|
|
|
|
__fp16 t2() { return g; }
|
2020-12-31 16:27:11 +08:00
|
|
|
// SOFT: define{{.*}} half @t2()
|
|
|
|
// HARD: define{{.*}} arm_aapcs_vfpcc half @t2()
|
|
|
|
// NATIVE: define{{.*}} half @t2()
|
2020-06-09 16:52:01 +08:00
|
|
|
// CHECK: [[LOAD:%.*]] = load half, half* @g
|
|
|
|
// CHECK: ret half [[LOAD]]
|
2018-01-23 18:13:49 +08:00
|
|
|
|
|
|
|
_Float16 h;
|
|
|
|
|
|
|
|
void t3(_Float16 a) { h = a; }
|
2022-01-16 17:53:11 +08:00
|
|
|
// SOFT: define{{.*}} void @t3(half noundef [[PARAM:%.*]])
|
|
|
|
// HARD: define{{.*}} arm_aapcs_vfpcc void @t3(half noundef [[PARAM:%.*]])
|
|
|
|
// NATIVE: define{{.*}} void @t3(half noundef [[PARAM:%.*]])
|
2020-06-09 16:52:01 +08:00
|
|
|
// CHECK: store half [[PARAM]], half* @h
|
2018-01-23 18:13:49 +08:00
|
|
|
|
|
|
|
_Float16 t4() { return h; }
|
2020-12-31 16:27:11 +08:00
|
|
|
// SOFT: define{{.*}} half @t4()
|
|
|
|
// HARD: define{{.*}} arm_aapcs_vfpcc half @t4()
|
|
|
|
// NATIVE: define{{.*}} half @t4()
|
2020-06-09 16:52:01 +08:00
|
|
|
// CHECK: [[LOAD:%.*]] = load half, half* @h
|
|
|
|
// CHECK: ret half [[LOAD]]
|