[dart2wasm] Add dart2wasm never-inline pragma to a function being checked in a stack trace test
Fixes tests with optimized builds: - language/stack_trace/full1_test - language/stack_trace/stack_trace_test language/stack_trace/demangle_ctors_test will be fixed once we fix #62523. Change-Id: I788500e67045fa63783cc316eaf010728d077a3b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/476100 Commit-Queue: Ömer Ağacan <omersa@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com>
This commit is contained in:
committed by
Commit Queue
parent
992a07a552
commit
11b6bd85d6
@@ -7,20 +7,24 @@
|
||||
import "package:expect/expect.dart";
|
||||
|
||||
class SomeClass {
|
||||
@pragma("wasm:never-inline")
|
||||
SomeClass.namedConstructor() {
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
@pragma("wasm:never-inline")
|
||||
SomeClass() {
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
@pragma("wasm:never-inline")
|
||||
factory SomeClass.useFactory() {
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
|
||||
class OnlyHasFactory {
|
||||
@pragma("wasm:never-inline")
|
||||
factory OnlyHasFactory() {
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
@@ -13,16 +13,19 @@
|
||||
import "package:expect/expect.dart";
|
||||
|
||||
@pragma("vm:entry-point") // Prevents obfuscation
|
||||
@pragma("wasm:never-inline")
|
||||
void func1() {
|
||||
throw new Exception("Test full stacktrace");
|
||||
}
|
||||
|
||||
@pragma("vm:entry-point") // Prevents obfuscation
|
||||
@pragma("wasm:never-inline")
|
||||
void func2() {
|
||||
func1();
|
||||
}
|
||||
|
||||
@pragma("vm:entry-point") // Prevents obfuscation
|
||||
@pragma("wasm:never-inline")
|
||||
void func3() {
|
||||
try {
|
||||
func2();
|
||||
@@ -39,23 +42,27 @@ void func3() {
|
||||
}
|
||||
|
||||
@pragma("vm:entry-point") // Prevents obfuscation
|
||||
@pragma("wasm:never-inline")
|
||||
int func4() {
|
||||
func3();
|
||||
return 1;
|
||||
}
|
||||
|
||||
@pragma("vm:entry-point") // Prevents obfuscation
|
||||
@pragma("wasm:never-inline")
|
||||
int func5() {
|
||||
func4();
|
||||
return 1;
|
||||
}
|
||||
|
||||
@pragma("vm:entry-point") // Prevents obfuscation
|
||||
@pragma("wasm:never-inline")
|
||||
int func6() {
|
||||
func5();
|
||||
return 1;
|
||||
}
|
||||
|
||||
@pragma("wasm:never-inline")
|
||||
main() {
|
||||
var i = func6();
|
||||
Expect.equals(1, i);
|
||||
|
||||
@@ -89,6 +89,7 @@ class RethrowStacktraceTest {
|
||||
|
||||
@pragma("vm:entry-point") // Prevent obfuscation
|
||||
@pragma("vm:never-inline") // Prevent inlining
|
||||
@pragma("wasm:never-inline")
|
||||
issue12940() {
|
||||
throw "Progy";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user