Skip to content

[WebAssembly] Add intentations to type-checker-error.s #111071

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

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 42 additions & 42 deletions llvm/test/MC/WebAssembly/type-checker-errors.s
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ end_block_insufficient_values_on_stack_2:
end_block_type_mismatch:
.functype end_block_type_mismatch () -> ()
block i32
f32.const 1.0
f32.const 1.0
# CHECK: :[[@LINE+1]]:3: error: type mismatch, expected [i32] but got [f32]
end_block
drop
Expand All @@ -314,7 +314,7 @@ end_loop_insufficient_values_on_stack:
end_loop_type_mismatch:
.functype end_loop_type_mismatch () -> ()
loop f32
i32.const 1
i32.const 1
# CHECK: :[[@LINE+1]]:3: error: type mismatch, expected [f32] but got [i32]
end_loop
drop
Expand All @@ -332,7 +332,7 @@ end_if_type_mismatch_1:
.functype end_if_type_mismatch_1 () -> ()
i32.const 1
if f32
i32.const 1
i32.const 1
# CHECK: :[[@LINE+1]]:3: error: type mismatch, expected [f32] but got [i32]
end_if
drop
Expand All @@ -342,7 +342,7 @@ end_if_insufficient_values_on_stack_2:
.functype end_if_insufficient_values_on_stack_2 () -> ()
i32.const 1
if i32
i32.const 2
i32.const 2
else
# CHECK: :[[@LINE+1]]:3: error: type mismatch, expected [i32] but got []
end_if
Expand All @@ -353,9 +353,9 @@ end_if_type_mismatch_2:
.functype end_if_type_mismatch_2 () -> ()
i32.const 1
if i32
i32.const 2
i32.const 2
else
f32.const 3.0
f32.const 3.0
# CHECK: :[[@LINE+1]]:3: error: type mismatch, expected [i32] but got [f32]
end_if
drop
Expand All @@ -367,7 +367,7 @@ else_insufficient_values_on_stack:
if i32
# CHECK: :[[@LINE+1]]:3: error: type mismatch, expected [i32] but got []
else
i32.const 0
i32.const 0
end_if
drop
end_function
Expand All @@ -376,10 +376,10 @@ else_type_mismatch:
.functype else_type_mismatch () -> ()
i32.const 1
if i32
f32.const 0.0
f32.const 0.0
# CHECK: :[[@LINE+1]]:3: error: type mismatch, expected [i32] but got [f32]
else
i32.const 0
i32.const 0
end_if
drop
end_function
Expand All @@ -390,7 +390,7 @@ else_type_mismatch:
end_try_insufficient_values_on_stack:
.functype end_try_insufficient_values_on_stack () -> ()
try i32
i32.const 0
i32.const 0
catch_all
# CHECK: :[[@LINE+1]]:3: error: type mismatch, expected [i32] but got []
end_try
Expand All @@ -400,7 +400,7 @@ end_try_insufficient_values_on_stack:
end_try_type_mismatch:
.functype end_try_type_mismatch () -> ()
try i32
i32.const 0
i32.const 0
catch tag_f32
# CHECK: :[[@LINE+1]]:3: error: type mismatch, expected [i32] but got [f32]
end_try
Expand All @@ -419,7 +419,7 @@ catch_insufficient_values_on_stack:
catch_type_mismatch:
.functype catch_type_mismatch () -> ()
try i32
f32.const 1.0
f32.const 1.0
# CHECK: :[[@LINE+1]]:3: error: type mismatch, expected [i32] but got [f32]
catch tag_i32
end_try
Expand All @@ -431,18 +431,18 @@ catch_all_insufficient_values_on_stack:
try i32
# CHECK: :[[@LINE+1]]:3: error: type mismatch, expected [i32] but got []
catch_all
i32.const 0
i32.const 0
end_try
drop
end_function

catch_all_type_mismatch:
.functype catch_all_type_mismatch () -> ()
try i32
f32.const 1.0
f32.const 1.0
# CHECK: :[[@LINE+1]]:3: error: type mismatch, expected [i32] but got [f32]
catch_all
i32.const 0
i32.const 0
end_try
drop
end_function
Expand All @@ -458,7 +458,7 @@ delegate_insufficient_values_on_stack:
delegate_type_mismatch:
.functype delegate_type_mismatch () -> ()
try i32
f32.const 1.0
f32.const 1.0
# CHECK: :[[@LINE+1]]:3: error: type mismatch, expected [i32] but got [f32]
delegate 0
drop
Expand Down Expand Up @@ -679,7 +679,7 @@ other_insn_test_3:
check_after_unreachable_within_block:
.functype check_after_unreachable_within_block () -> ()
block
unreachable
unreachable
end_block
# CHECK: :[[@LINE+1]]:3: error: type mismatch, expected [any] but got []
drop
Expand All @@ -689,7 +689,7 @@ check_after_unreachable_within_block:
check_after_unreachable_within_loop:
.functype check_after_unreachable_within_loop () -> ()
loop
unreachable
unreachable
end_loop
# CHECK: :[[@LINE+1]]:3: error: type mismatch, expected [any] but got []
drop
Expand All @@ -700,9 +700,9 @@ check_after_unreachable_within_if_1:
.functype check_after_unreachable_within_if_1 () -> ()
i32.const 0
if
unreachable
unreachable
else
unreachable
unreachable
end_if
# CHECK: :[[@LINE+1]]:3: error: type mismatch, expected [any] but got []
drop
Expand All @@ -713,20 +713,20 @@ check_after_unreachable_within_if_2:
.functype check_after_unreachable_within_if_2 () -> ()
i32.const 0
if
unreachable
unreachable
else
# CHECK: :[[@LINE+1]]:3: error: type mismatch, expected [any] but got []
drop
# CHECK: :[[@LINE+1]]:5: error: type mismatch, expected [any] but got []
drop
end_if
end_function

# Unreachable code within 'try' does not affect type checking after 'end_try'
check_after_unreachable_within_try_1:
.functype check_after_unreachable_within_try_1 () -> ()
try
unreachable
unreachable
catch_all
unreachable
unreachable
end_try
# CHECK: :[[@LINE+1]]:3: error: type mismatch, expected [any] but got []
drop
Expand All @@ -736,30 +736,30 @@ check_after_unreachable_within_try_1:
check_after_unreachable_within_try_2:
.functype check_after_unreachable_within_try_2 () -> ()
try
unreachable
unreachable
catch tag_i32
drop
# CHECK: :[[@LINE+1]]:3: error: type mismatch, expected [any] but got []
drop
drop
# CHECK: :[[@LINE+1]]:5: error: type mismatch, expected [any] but got []
drop
end_try
end_function

# Unreachable code within 'try' does not affect type checking after 'catch_all'
check_after_unreachable_within_try_3:
.functype check_after_unreachable_within_try_3 () -> ()
try
unreachable
unreachable
catch_all
# CHECK: :[[@LINE+1]]:3: error: type mismatch, expected [any] but got []
drop
# CHECK: :[[@LINE+1]]:5: error: type mismatch, expected [any] but got []
drop
end_try
end_function

# Unreachable code within 'try' does not affect type checking after 'delegate'
check_after_unreachable_within_try_4:
.functype check_after_unreachable_within_try_4 () -> ()
try
unreachable
unreachable
delegate 0
# CHECK: :[[@LINE+1]]:3: error: type mismatch, expected [any] but got []
drop
Expand Down Expand Up @@ -838,12 +838,12 @@ br_invalid_type_catch_all:
br_invalid_depth_out_of_range:
.functype br_invalid_depth_out_of_range () -> ()
block
block
block
# CHECK: :[[@LINE+1]]:5: error: br: invalid depth 4
br 4
end_block
end_block
block
block
# CHECK: :[[@LINE+1]]:9: error: br: invalid depth 4
br 4
end_block
end_block
end_block
end_function

Expand Down Expand Up @@ -936,9 +936,9 @@ block_param_and_return:
drop

block f32
f32.const 0.0
br 0
i32.const 0
f32.const 0.0
br 0
i32.const 0
# CHECK: :[[@LINE+1]]:3: error: type mismatch, expected [f32] but got [..., i32]
end_block

Expand Down
Loading