Skip to content

test: Fix test/IRGen/moveonly_value_functions.sil for 32-bit targets #74786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

kateinoigakukun
Copy link
Member

@kateinoigakukun kateinoigakukun commented Jun 27, 2024

We cannot assume Int is backed by BuiltIn.Int64 and ptr offset is i64. Function declaration names are renamed to avoid signature mismatch with the real imported declaration.

--
Exit Code: 2

Command Output (stderr):
--
SIL verification failed: struct operand type does not match field type
  $Builtin.Int64
  $Builtin.Int32
Verifying instruction:
     %5 = integer_literal $Builtin.Int64, 1       // user: %6
->   %6 = struct $Int (%5 : $Builtin.Int64)       // user: %8
     %8 = apply %7<Value>(%6, %4) : $@convention(method) <τ_0_0 where τ_0_0 : ~Copyable> (Int, UnsafeMutablePointer<τ_0_0>) -> UnsafeMutableRawPointer
In function:
// _Cell<>.deinit
sil @$s15Synchronization5_CellVAARi_zrlEfD : $@convention(method) <Value where Value : ~Copyable> (@in _Cell<Value>) -> () {
// %0                                             // user: %2
bb0(%0 : $*_Cell<Value>):
  %1 = alloc_stack $_Cell<Value>                  // users: %10, %3, %2
  copy_addr [take] %0 to [init] %1 : $*_Cell<Value> // id: %2
  %3 = builtin "addressOfRawLayout"<_Cell<Value>>(%1 : $*_Cell<Value>) : $Builtin.RawPointer // user: %4
  %4 = struct $UnsafeMutablePointer<Value> (%3 : $Builtin.RawPointer) // user: %8
  %5 = integer_literal $Builtin.Int64, 1          // user: %6
  %6 = struct $Int (%5 : $Builtin.Int64)          // user: %8
  // function_ref UnsafeMutablePointer.deinitialize(count:)
  %7 = function_ref @$sSp12deinitialize5countSvSi_tF : $@convention(method) <τ_0_0 where τ_0_0 : ~Copyable> (Int, UnsafeMutablePointer<τ_0_0>) -> UnsafeMutableRawPointer // user: %8
  %8 = apply %7<Value>(%6, %4) : $@convention(method) <τ_0_0 where τ_0_0 : ~Copyable> (Int, UnsafeMutablePointer<τ_0_0>) -> UnsafeMutableRawPointer
  %9 = tuple ()                                   // user: %11
  dealloc_stack %1 : $*_Cell<Value>               // id: %10
  return %9 : $()                                 // id: %11
} // end sil function '$s15Synchronization5_CellVAARi_zrlEfD'

https://ci.swift.org/job/oss-swift-pr-test-crosscompile-wasm-ubuntu-20_04/1034/console

@kateinoigakukun kateinoigakukun marked this pull request as ready for review June 27, 2024 16:51
@kateinoigakukun
Copy link
Member Author

@swift-ci test WebAssembly

@kateinoigakukun
Copy link
Member Author

@swift-ci smoke test

Copy link
Contributor

@nate-chandler nate-chandler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment inline.

We cannot assume Int is backed by BuiltIn.Int64 and ptr offset is i64.

Co-authored-by: Nate Chandler <[email protected]>
@kateinoigakukun kateinoigakukun force-pushed the yt/fix-moveonly_value_functions-32bit branch from d03493b to d47ce07 Compare June 27, 2024 17:36
@kateinoigakukun
Copy link
Member Author

@swift-ci smoke test

@kateinoigakukun
Copy link
Member Author

@swift-ci test WebAssembly

Copy link
Contributor

@nate-chandler nate-chandler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@nate-chandler
Copy link
Contributor

@swift-ci please test windows platform

@kateinoigakukun kateinoigakukun merged commit 2918532 into swiftlang:main Jun 28, 2024
4 checks passed
@kateinoigakukun kateinoigakukun deleted the yt/fix-moveonly_value_functions-32bit branch June 28, 2024 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants