Files
swift-mirror/test/Interop/C/swiftify-import/counted-by-no-swiftify.swift
Henrik G. Olsson 8db1ad6222 Cherry-pick [Swiftify] Don't import counted_by with suffixed integer literals (#82469) (#82594)
Integer literal expressions with types that are not of type `int` are
printed with a suffix to indicate the type (e.g. `123U` or `456L` for
`unsigned` and `long`). This is not valid syntax for integer literals in
Swift, so until we fully translate the count expr syntax to Swift we
need to avoid importing these count expressions.

Also fixes some -Werror related stuff in test cases.

rdar://154141719
(cherry picked from commit 374658a)
2025-06-30 11:58:55 -07:00

19 lines
1.1 KiB
Swift

// RUN: %target-swift-ide-test -print-module -module-to-print=CountedByClang -plugin-path %swift-plugin-dir -I %S/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers -Xcc -Werror -Xcc -Wno-nullability-completeness -Xcc -Wno-div-by-zero -Xcc -Wno-pointer-to-int-cast | %FileCheck %s
// REQUIRES: swift_feature_SafeInteropWrappers
// These functions use __counted_by annotations that are not syntactically valid
// in Swift, so they should not be Swiftified
// CHECK-NOT: @_alwaysEmitIntoClient {{.*}} derefLen
// CHECK-NOT: @_alwaysEmitIntoClient {{.*}} lNot
// CHECK-NOT: @_alwaysEmitIntoClient {{.*}} lAnd
// CHECK-NOT: @_alwaysEmitIntoClient {{.*}} lOr
// CHECK-NOT: @_alwaysEmitIntoClient {{.*}} floatCastToInt
// CHECK-NOT: @_alwaysEmitIntoClient {{.*}} pointerCastToInt
// CHECK-NOT: @_alwaysEmitIntoClient {{.*}} nanAsInt
// CHECK-NOT: @_alwaysEmitIntoClient {{.*}} unsignedLiteral
// CHECK-NOT: @_alwaysEmitIntoClient {{.*}} longLiteral
// CHECK-NOT: @_alwaysEmitIntoClient {{.*}} sizeofType
// CHECK-NOT: @_alwaysEmitIntoClient {{.*}} sizeofParam