llvm-project/clang/test/CodeGen/builtins-msp430.c
Qiu Chaofan a40ef656d8 [Intrinsic] Rename flt.rounds intrinsic to get.rounding
Address the inconsistency between FLT_ROUNDS_ and SET_ROUNDING SDAG
node. Rename FLT_ROUNDS_ to GET_ROUNDING and add llvm.get.rounding
intrinsic to replace flt.rounds.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D139507
2022-12-19 15:22:39 +08:00

11 lines
356 B
C

// REQUIRES: msp430-registered-target
// RUN: %clang_cc1 -triple msp430-unknown-unknown -emit-llvm %s -o - | FileCheck %s
int test_builtin_flt_rounds() {
// CHECK: [[V0:[%A-Za-z0-9.]+]] = call i32 @llvm.get.rounding()
// CHECK-DAG: [[V1:[%A-Za-z0-9.]+]] = trunc i32 [[V0]] to i16
// CHECK-DAG: ret i16 [[V1]]
return __builtin_flt_rounds();
}