mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-24 05:55:43 -04:00

llvm.flt.rounds returns an i32, but the builtin expects an integer. On targets where integers are not 32-bits clang tries to bitcast the result, causing an assertion failure. The patch enables newlib build for msp430. Patch by Edward Jones! Differential Revision: https://reviews.llvm.org/D24461 llvm-svn: 351449
11 lines
354 B
C
11 lines
354 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.flt.rounds()
|
|
// CHECK-DAG: [[V1:[%A-Za-z0-9.]+]] = trunc i32 [[V0]] to i16
|
|
// CHECK-DAG: ret i16 [[V1]]
|
|
return __builtin_flt_rounds();
|
|
}
|
|
|