Index: lib/CodeGen/TargetLoweringBase.cpp =================================================================== --- lib/CodeGen/TargetLoweringBase.cpp +++ lib/CodeGen/TargetLoweringBase.cpp @@ -487,7 +487,7 @@ Names[RTLIB::ATOMIC_FETCH_NAND_8] = "__atomic_fetch_nand_8"; Names[RTLIB::ATOMIC_FETCH_NAND_16] = "__atomic_fetch_nand_16"; - if (TT.isGNUEnvironment()) { + if (TT.isOSLinux()) { Names[RTLIB::SINCOS_F32] = "sincosf"; Names[RTLIB::SINCOS_F64] = "sincos"; Names[RTLIB::SINCOS_F80] = "sincosl"; Index: test/CodeGen/ARM/sincos.ll =================================================================== --- test/CodeGen/ARM/sincos.ll +++ test/CodeGen/ARM/sincos.ll @@ -3,6 +3,8 @@ ; RUN: llc < %s -mtriple=armv7-linux-gnu -mcpu=cortex-a8 | FileCheck %s --check-prefix=NOOPT-GNU ; RUN: llc < %s -mtriple=armv7-linux-gnueabi -mcpu=cortex-a8 \ ; RUN: --enable-unsafe-fp-math | FileCheck %s --check-prefix=SINCOS-GNU +; RUN: llc < %s -mtriple=armv7-freebsd-gnueabi -mcpu=cortex-a8 \ +; RUN: --enable-unsafe-fp-math | FileCheck %s --check-prefix=NOOPT-FREEBSD ; Combine sin / cos into a single call. ; rdar://12856873 @@ -23,6 +25,10 @@ ; NOOPT-GNU: bl sinf ; NOOPT-GNU: bl cosf +; NOOPT-FREEBSD-LABEL: test1: +; NOOPT-FREEBSD: bl sinf +; NOOPT-FREEBSD: bl cosf + %call = tail call float @sinf(float %x) nounwind readnone %call1 = tail call float @cosf(float %x) nounwind readnone %add = fadd float %call, %call1 @@ -44,6 +50,10 @@ ; NOOPT-GNU-LABEL: test2: ; NOOPT-GNU: bl sin ; NOOPT-GNU: bl cos + +; NOOPT-FREEBSD-LABEL: test2: +; NOOPT-FREEBSD: bl sin +; NOOPT-FREEBSD: bl cos %call = tail call double @sin(double %x) nounwind readnone %call1 = tail call double @cos(double %x) nounwind readnone %add = fadd double %call, %call1