Files
swift-mirror/test/Interop/Cxx/stdlib/avoid-import-cxx-math.swift
Evan Wilde 3a48d6e95e FreeBSD: Enable a few more C++ interop tests
Some of these tests were marked as unsupported since they were only
checking for macOS and Linux. They seem to be passing on FreeBSD as
well, so enabling them here.
2025-06-18 16:16:34 -07:00

30 lines
807 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 || OS=freebsd
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)
}