-
Notifications
You must be signed in to change notification settings - Fork 11k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Flang] Replace notifyMatchFailure with TODO hard failures
For unimplemented patterns we revert to using TODO hard failures instead of notifyMatchFailure. For fir.select_type revert to using mlir::emiterror. For the fir.embox TODO on a type with len params we cannot add a test since the type cannot be converted to llvm. Adding negative tests using not and checking for the error message. TODO exits with an error in a build without assertion but aborts in a build with assertions. Abort requires using not with the --crash option. The two different usages of not is handled by using a custom command %not_todo_cmd which is converted to not or not --crash depending on the presence or absence of assertions. Using llvm-config to check the presence of assertions. Reviewed By: clementval, awarzynski Differential Revision: https://reviews.llvm.org/D114371
- Loading branch information
1 parent
6f25e75
commit 7ce8c6f
Showing
14 changed files
with
179 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// RUN: not fir-opt --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" %s 2>&1 | FileCheck %s | ||
|
||
// Test that `fir.boxproc_host` fails conversion to llvm. | ||
// At the moment this test fails since `fir.boxproc` type does not have a conversion. | ||
|
||
// CHECK: failed to legalize operation 'builtin.func' | ||
func @test(%bproc: !fir.boxproc<(i32) -> ()>) { | ||
%tuple = fir.boxproc_host %bproc : (!fir.boxproc<(i32) -> ()>) -> (!fir.ref<tuple<i32,f64>>) | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// RUN: %not_todo_cmd fir-opt --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" %s 2>&1 | FileCheck %s | ||
|
||
// Test `fir.dispatch` conversion to llvm. | ||
// Not implemented yet. | ||
|
||
func @dispatch(%arg0: !fir.box<!fir.type<derived3{f:f32}>>) { | ||
// CHECK: not yet implemented fir.dispatch codegen | ||
%0 = fir.dispatch "method"(%arg0) : (!fir.box<!fir.type<derived3{f:f32}>>) -> i32 | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// RUN: %not_todo_cmd fir-opt --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" %s 2>&1 | FileCheck %s | ||
|
||
// Test fir.dispatch_table conversion to llvm. | ||
// Not implemented yet. | ||
|
||
// CHECK: not yet implemented fir.dispatch_table codegen | ||
fir.dispatch_table @dispatch_tbl { | ||
fir.dt_entry "method", @method_impl | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// RUN: %not_todo_cmd fir-opt --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" %s 2>&1 | FileCheck %s | ||
|
||
// Test `fir.emboxproc` conversion to llvm. | ||
// Not implemented yet. | ||
|
||
func @emboxproc_test() { | ||
%host_vars = fir.alloca tuple<i32,f64> | ||
// CHECK: not yet implemented fir.emboxproc codegen | ||
%bproc = fir.emboxproc @method_impl, %host_vars : ((i32) -> (), !fir.ref<tuple<i32,f64>>) -> !fir.boxproc<(i32) -> ()> | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// RUN: %not_todo_cmd fir-opt --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" %s 2>&1 | FileCheck %s | ||
|
||
// Test `fir.end` conversion to llvm. | ||
// Not implemented yet. | ||
|
||
func @end_test() { | ||
// CHECK: not yet implemented fir.end codegen | ||
"fir.end"() : () -> () | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// RUN: %not_todo_cmd fir-opt --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" %s 2>&1 | FileCheck %s | ||
|
||
// Test `fir.gentypedesc` conversion to llvm. | ||
// Not implemented yet. | ||
|
||
func @gentypedesc() { | ||
// CHECK: not yet implemented fir.gentypedesc codegen | ||
%0 = fir.gentypedesc !fir.type<derived3> | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// RUN: %not_todo_cmd fir-opt --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" %s 2>&1 | FileCheck %s | ||
|
||
// Test `fir.global_len` conversion to llvm. | ||
// Not implemented yet. | ||
|
||
fir.global @global_derived : !fir.type<minez(f:i32)> { | ||
// CHECK: not yet implemented fir.global_len codegen | ||
fir.global_len f, 1 : i32 | ||
%0 = fir.undefined !fir.type<minez> | ||
fir.has_value %0 : !fir.type<minez> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// RUN: %not_todo_cmd fir-opt --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" %s 2>&1 | FileCheck %s | ||
|
||
// Test `fir.len_param_index` conversion to llvm. | ||
// Not implemented yet. | ||
|
||
func @lenparamindex() { | ||
// CHECK: not yet implemented fir.len_param_index codegen | ||
%0 = fir.len_param_index l1, !fir.type<twolens(l1:i32, l2:i32){i:i32, f:f32, l:i64}> | ||
return | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// RUN: %not_todo_cmd fir-opt --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" %s 2>&1 | FileCheck %s | ||
|
||
// Test `fir.select_case` conversion to llvm with character type. | ||
// Not implemented yet. | ||
|
||
func @select_case_charachter(%arg0: !fir.char<2, 10>, %arg1: !fir.char<2, 10>, %arg2: !fir.char<2, 10>) { | ||
// CHECK: not yet implemented fir.select_case codegen with character type | ||
fir.select_case %arg0 : !fir.char<2, 10> [#fir.point, %arg1, ^bb1, | ||
#fir.point, %arg2, ^bb2, | ||
unit, ^bb3] | ||
^bb1: | ||
%c1_i32 = arith.constant 1 : i32 | ||
br ^bb3 | ||
^bb2: | ||
%c2_i32 = arith.constant 2 : i32 | ||
br ^bb3 | ||
^bb3: | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// RUN: not fir-opt --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" %s 2>&1 | FileCheck %s | ||
|
||
// Test `fir.unboxproc` conversion to llvm. | ||
// Not implemented yet. | ||
// Currently fails since coversion for boxproc type is not implemented. | ||
|
||
// CHECK: failed to legalize operation 'builtin.func' | ||
func @boxing_match(%bproc: !fir.boxproc<(i32) -> ()>) { | ||
%ubproc:2 = fir.unboxproc %bproc : (!fir.boxproc<(i32) -> ()>) -> ((i32) -> (), !fir.ref<tuple<i32,f64>>) | ||
return | ||
} |
Oops, something went wrong.