Commit 71fe3dd8 authored by franzih's avatar franzih Committed by Commit bot

[type-profile] Add test for fall-off return.

Add a test case as reminder for future work.

There is no return statement, therefore 'undefined' should be the type.

R=mstarzinger@chromium.org
BUG=v8:5935

Review-Url: https://codereview.chromium.org/2768503002
Cr-Commit-Position: refs/heads/master@{#44009}
parent 37b9d653
...@@ -14,6 +14,10 @@ function testFunction(param, flag) { ...@@ -14,6 +14,10 @@ function testFunction(param, flag) {
return second_var; return second_var;
} }
class MyClass {
constructor() {}
}
%PrintTypeProfile(testFunction); %PrintTypeProfile(testFunction);
testFunction({}); testFunction({});
...@@ -26,22 +30,10 @@ testFunction(undefined); ...@@ -26,22 +30,10 @@ testFunction(undefined);
testFunction('hello', true); testFunction('hello', true);
testFunction({x: 12}, true); testFunction({x: 12}, true);
testFunction({x: 12}); testFunction({x: 12});
testFunction(new MyClass());
%PrintTypeProfile(testFunction); %PrintTypeProfile(testFunction);
class MyClass {
constructor() {}
}
function testConstructorNames(param) {
var my_var = param;
}
testConstructorNames(new MyClass());
testConstructorNames({});
testConstructorNames(2);
function testReturnOfNonVariable() { function testReturnOfNonVariable() {
return 32; return 32;
} }
...@@ -55,11 +47,18 @@ function try_finally() { ...@@ -55,11 +47,18 @@ function try_finally() {
return "nope, string is better" return "nope, string is better"
} }
} }
try_finally(); try_finally();
%PrintTypeProfile(try_finally); %PrintTypeProfile(try_finally);
// TODO(franzih): 'undefined' should be the return type.
function fall_off() {
//nothing
}
fall_off();
%PrintTypeProfile(fall_off);
testReturnOfNonVariable(); testReturnOfNonVariable();
......
...@@ -13,11 +13,14 @@ Function: testFunction ...@@ -13,11 +13,14 @@ Function: testFunction
374: string 374: string
374: Object 374: Object
424: Object 424: Object
424: MyClass
Function: try_finally Function: try_finally
1157: number 1032: number
1186: string 1061: string
*%(basename)s:66: throw otherwise test fails with --stress-opt Function: fall_off
*%(basename)s:65: throw otherwise test fails with --stress-opt
throw "throw otherwise test fails with --stress-opt"; throw "throw otherwise test fails with --stress-opt";
^ ^
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment