mirror of
https://github.com/apple/swift.git
synced 2026-02-27 18:26:24 +01:00
- Correctly construct cmake cmdline for wasmstdlib including cmake common host options. This is required in order to include e.g. `CMAKE_OSX_SYSROOT` on macOS, etc. - Ensure we're passing path to newly-built SDK to sil-opt This makes almost every AutoDiff tests passing for Wasm target (the only exception is `AutoDiff/validation-test/always_emit_into_client/multi_module_struct_no_jvp.swift` as `expectCrash()` is not working properly on Wasm.
29 lines
1.2 KiB
Plaintext
29 lines
1.2 KiB
Plaintext
// RUN: %target-sil-opt -sil-print-types -differentiation -enable-experimental-linear-map-transposition %s | %FileCheck %s
|
|
|
|
sil_stage raw
|
|
|
|
import Swift
|
|
import Builtin
|
|
|
|
import _Differentiation
|
|
|
|
sil hidden @foo : $@convention(thin) (Float, Float, Float) -> Float {
|
|
bb0(%0 : $Float, %1 : $Float, %2 : $Float):
|
|
return %2 : $Float
|
|
}
|
|
|
|
sil @make_linear_func : $@convention(thin) () -> () {
|
|
bb0:
|
|
%orig = function_ref @foo : $@convention(thin) (Float, Float, Float) -> Float
|
|
%linear_fn_0 = linear_function [parameters 0] %orig : $@convention(thin) (Float, Float, Float) -> Float
|
|
%linear_fn_1 = linear_function [parameters 0 2] %orig : $@convention(thin) (Float, Float, Float) -> Float
|
|
return undef : $()
|
|
}
|
|
|
|
// CHECK-LABEL: sil @make_linear_func
|
|
// CHECK: bb0:
|
|
// CHECK: [[ORIG_FN:%.*]] = function_ref @foo : $@convention(thin) (Float, Float, Float) -> Float
|
|
// CHECK: linear_function [parameters 0] %0 : $@convention(thin) (Float, Float, Float) -> Float with_transpose undef : $@convention(thin) (Float, Float, Float) -> Float
|
|
// CHECK: linear_function [parameters 0 2] %0 : $@convention(thin) (Float, Float, Float) -> Float with_transpose undef : $@convention(thin) (Float, Float) -> (Float, Float)
|
|
// CHECK: }
|