mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Clang is using C++17 standard version by default since Clang 16. Swift’s ClangImporter should do the same, to make sure that clients who run clang and then swiftc without explicit std version see consistent behavior. rdar://125777068
30 lines
793 B
Swift
30 lines
793 B
Swift
// RUN: %target-swift-frontend %s -typecheck -verify -enable-experimental-cxx-interop
|
|
// RUN: %target-swift-frontend %s -typecheck -verify -cxx-interoperability-mode=swift-6
|
|
// RUN: %target-swift-frontend %s -typecheck -verify -cxx-interoperability-mode=upcoming-swift
|
|
|
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
|
|
|
import CxxStdlib
|
|
|
|
func test() {
|
|
let x: Double = 1.0
|
|
let y: Double = 2.0
|
|
|
|
let _ = pow(x, y)
|
|
|
|
let _ = abs(x)
|
|
// https://github.com/apple/swift/issues/67006
|
|
// let _ = div(42, 2)
|
|
let _ = sin(x)
|
|
let _ = cos(x)
|
|
|
|
// strstr comes from stdlib.h or cstdlib on *some* flavors of linux, so it
|
|
// won't get imported. We may need a more fine grained approach for those
|
|
// platforms.
|
|
#if !os(Linux)
|
|
let _ = strstr("a", "aaa")
|
|
#endif
|
|
|
|
exit(0)
|
|
}
|