mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Set default CPU for s390x to support conversion between unsigned integers and floating point numbers (#9647)
This commit is contained in:
@@ -682,6 +682,8 @@ addCommonInvocationArguments(std::vector<std::string> &invocationArgStrs,
|
||||
triple.getArch() == llvm::Triple::aarch64_be) {
|
||||
invocationArgStrs.push_back("-mcpu=cyclone");
|
||||
}
|
||||
} else if (triple.getArch() == llvm::Triple::systemz) {
|
||||
invocationArgStrs.push_back("-march=z196");
|
||||
}
|
||||
|
||||
const std::string &overrideResourceDir = importerOpts.OverrideResourceDir;
|
||||
|
||||
10
test/Misc/floatTruncation.swift
Normal file
10
test/Misc/floatTruncation.swift
Normal file
@@ -0,0 +1,10 @@
|
||||
// RUN: %target-swift-frontend -parse-stdlib -emit-assembly %s -o - | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-cpu
|
||||
|
||||
// test converting floating point to unsigned integer
|
||||
import Swift
|
||||
let f = -123.0 as Float
|
||||
let x = Builtin.fptoui_FPIEEE32_Int8(f._value)
|
||||
|
||||
// CHECK-NOT: (dummy CHECK line to avoid FileCheck complaints)
|
||||
// CHECK-s390x: clfebr %r{{[0-9]+}}, {{[0-7]+}}, %f{{[0-9]+}}, {{[0-9]+}}
|
||||
|
||||
@@ -37,3 +37,6 @@
|
||||
// RUN: not %swift -typecheck -target x86_64-apple-watchos2 -Xcc -### %s 2>&1 | %FileCheck -check-prefix=WATCHSIMULATOR64_CPU %s
|
||||
// WATCHSIMULATOR64_CPU: "-target-cpu" "core2"
|
||||
|
||||
// RUN: not %swift -typecheck -target s390x-unknown-linux-gnu -Xcc -### %s 2>&1 | %FileCheck -check-prefix=S390X_CPU %s
|
||||
// S390X_CPU: "-target-cpu" "z196"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user