945f32dfc7
This also brings in two fixes for issues we filed upstream * https://github.com/WebAssembly/binaryen/issues/7981 * https://github.com/WebAssembly/binaryen/issues/7982 This fixes some test failures that are due to binaryen crashes. This makes us have wasm struct field names where they were removed before. Change-Id: Ia3d0d344bd5230cc1ec439123a4cca7dccc8a655 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/457340 Reviewed-by: Slava Egorov <vegorov@google.com> Commit-Queue: Martin Kustermann <kustermann@google.com>
55 lines
1.3 KiB
Dart
55 lines
1.3 KiB
Dart
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
// functionFilter=test|roundTrip
|
|
// globalFilter=DoesNotMatch
|
|
// tableFilter=DoesNotMatch
|
|
|
|
import 'dart:js_interop';
|
|
|
|
@JS()
|
|
external String roundTripString(String s);
|
|
|
|
@JS()
|
|
external String? roundTripStringNullable(String? s);
|
|
|
|
final ktrue = int.parse('1') == 1;
|
|
|
|
final stringValue = ktrue ? 'a' : 'b';
|
|
final stringValueNullable = ktrue ? stringValue : null;
|
|
|
|
@pragma('wasm:never-inline')
|
|
void main() {
|
|
testStringConstant();
|
|
testStringConstantNullable();
|
|
testStringValue();
|
|
testStringValueNullable();
|
|
}
|
|
|
|
@pragma('wasm:never-inline')
|
|
void testStringConstant() {
|
|
sinkString(roundTripString('a'));
|
|
}
|
|
|
|
@pragma('wasm:never-inline')
|
|
void testStringConstantNullable() {
|
|
sinkStringNullable(roundTripStringNullable(null));
|
|
}
|
|
|
|
@pragma('wasm:never-inline')
|
|
void testStringValue() {
|
|
sinkString(roundTripString(stringValue));
|
|
}
|
|
|
|
@pragma('wasm:never-inline')
|
|
void testStringValueNullable() {
|
|
sinkStringNullable(roundTripStringNullable(stringValueNullable));
|
|
}
|
|
|
|
@pragma('wasm:never-inline')
|
|
void sinkString(String b) => print(b);
|
|
|
|
@pragma('wasm:never-inline')
|
|
void sinkStringNullable(String? b) => print(b);
|