mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This addresses the follow up test case discussed in PR23651. Windows will not promote a macro literal suffixed with `ll` or `i64` to an unsigned long long even upon an overflow. This tests that the corner case behaviour for importing a long long literal matches the platform expectations.
17 lines
442 B
Swift
17 lines
442 B
Swift
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -verify %s
|
|
|
|
import macros
|
|
|
|
func verifyIsSigned(_: Int64) { }
|
|
func verifyIsUnsigned(_: UInt64) { }
|
|
|
|
// Windows will not convert a long long value that overflows into an unsigned
|
|
// long long if it has the `ll` suffix of `i64` suffix. Ensure that the type is
|
|
// imported appropriately.
|
|
#if os(Windows)
|
|
verifyIsSigned(LL_TO_ULL)
|
|
#else
|
|
verifyIsUnsigned(LL_TO_ULL)
|
|
#endif
|
|
|