Skip to content

Commit ea37177

Browse files
authored
Merge pull request swiftlang#21018 from slavapestov/add-test-case
Add test case for https://bugs.swift.org/browse/SR-8963
2 parents 9c76f49 + 97cf3e6 commit ea37177

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed

include/swift/AST/Decl.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2913,9 +2913,6 @@ class GenericTypeParamDecl : public AbstractTypeParamDecl {
29132913
/// func getNext() -> Element?
29142914
/// }
29152915
/// \endcode
2916-
///
2917-
/// Every protocol has an implicitly-created associated type 'Self' that
2918-
/// describes a type that conforms to the protocol.
29192916
class AssociatedTypeDecl : public AbstractTypeParamDecl {
29202917
/// The location of the initial keyword.
29212918
SourceLoc KeywordLoc;
@@ -3875,6 +3872,14 @@ struct SelfReferenceKind {
38753872
/// protocol Drawable {
38763873
/// func draw()
38773874
/// }
3875+
///
3876+
/// Every protocol has an implicitly-created 'Self' generic parameter that
3877+
/// stands for a type that conforms to the protocol. For example,
3878+
///
3879+
/// protocol Cloneable {
3880+
/// func clone() -> Self
3881+
/// }
3882+
///
38783883
class ProtocolDecl final : public NominalTypeDecl {
38793884
SourceLoc ProtocolLoc;
38803885

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import ctypes
2+
3+
public struct MM {
4+
public var m: ModRM
5+
}
6+
7+
@inlinable public func f(_ m: MM) -> UInt32 {
8+
return m.m.rm
9+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-swift-frontend %clang-importer-sdk %S/Inputs/inlinable_bitfields_other.swift -emit-module -emit-module-path %t/inlinable_bitfields_other.swiftmodule
3+
// RUN: %target-swift-frontend %clang-importer-sdk -I %t %s -emit-ir -disable-llvm-optzns -O | %FileCheck %s -DINT=i%target-ptrsize
4+
5+
import inlinable_bitfields_other
6+
7+
public func g(_ m: MM) -> UInt32 {
8+
return f(m)
9+
}
10+
11+
// Just make sure this is a definition and not a declaration...
12+
13+
// CHECK: define internal i32 @"$ModRM$rm$getter"([[INT]] %.coerce)

0 commit comments

Comments
 (0)