Fix some FP operations on x86 targets under -opt
#KT-37412 Fixed
This commit is contained in:
committed by
GitHub
parent
3f3292e5b8
commit
dd161d614a
@@ -87,4 +87,10 @@ fun integralToFloat() {
|
||||
fun compareIntToFloat() {
|
||||
assertEquals(1, 0.compareTo(-0.0f))
|
||||
assertEquals(0, 0.compareTo(+0.0f))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testKt37412() {
|
||||
val two = 2.0
|
||||
assertEquals(2, two.toInt())
|
||||
}
|
||||
+11
-2
@@ -277,7 +277,11 @@ target-sysroot-xcode_11_4-watchos_x86.default = \
|
||||
arch.watchos_x86 = i386
|
||||
targetSysRoot.watchos_x86 = target-sysroot-xcode_11_4-watchos_x86
|
||||
|
||||
clangFlags.watchos_x86 = -cc1 -emit-obj -disable-llvm-passes -x ir
|
||||
# -target-cpu pentium4 makes sure that cogenerator knows which CPU flavour to emit code for.
|
||||
# Can be seen on optimized build and FP tests, where value is passed on stack
|
||||
# by Kotlin and taken from SSE registers by C code.
|
||||
# TODO: once this information is available in function attributes, we can remove this flag.
|
||||
clangFlags.watchos_x86 = -cc1 -emit-obj -disable-llvm-passes -x ir -target-cpu pentium4
|
||||
clangNooptFlags.watchos_x86 = -O1
|
||||
clangOptFlags.watchos_x86 = -O3
|
||||
clangDebugFlags.watchos_x86 = -O0
|
||||
@@ -549,7 +553,12 @@ dependencies.mingw_x64-android_x86 = \
|
||||
libffi-3.2.1-mingw-w64-x86-64
|
||||
|
||||
quadruple.android_x86 = i686-linux-android
|
||||
clangFlags.android_x86 = -cc1 -target-cpu i686 -emit-obj -disable-llvm-passes -x ir -femulated-tls -mrelocation-model pic
|
||||
|
||||
# -target-cpu pentium4 makes sure that cogenerator knows which CPU flavour to emit code for.
|
||||
# Can be seen on optimized build and FP tests, where value is passed on stack
|
||||
# by Kotlin and taken from SSE registers by C code.
|
||||
# TODO: once this information is available in function attributes, we can set target CPU to i686.
|
||||
clangFlags.android_x86 = -cc1 -target-cpu pentium4 -emit-obj -disable-llvm-passes -x ir -femulated-tls -mrelocation-model pic
|
||||
clangOptFlags.android_x86 = -O3 -ffunction-sections
|
||||
clangNooptFlags.android_x86 = -O1
|
||||
targetSysRoot.android_x86 = target-sysroot-1-android_ndk
|
||||
|
||||
Reference in New Issue
Block a user