Skip to content

Commit 97cf3e6

Browse files
committed
I believe this was fixed by swiftlang#19825, but this specific case with bitfield accessors is tricky so let's test it explicity.
1 parent a5ebaab commit 97cf3e6

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
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)