After submitting the DataLayout fix, some tests fail when they didn't before. This has to do with the target essentially being ignored when these tests were run earlier, as the --target x86-unknown-linux-gnu only has to be correctly formed to be accepted. Now the target triple is actually being used to get the targetmachine earlier - before MLIR is generated - so the test that has a valid target but not available on the platform fails. Fix is to require x86 registered target when running those tests. Reviewed By: awarzynski Differential Revision: https://reviews.llvm.org/D137335
21 lines
587 B
Plaintext
21 lines
587 B
Plaintext
// RUN: tco --inline-all %s -o - | FileCheck %s
|
|
// RUN: %flang_fc1 -mmlir --inline-all -emit-llvm %s -o - | FileCheck %s
|
|
|
|
// CHECK-LABEL: @add
|
|
func.func @add(%a : i32, %b : i32) -> i32 {
|
|
// CHECK: %[[add:.*]] = add i32
|
|
%p = arith.addi %a, %b : i32
|
|
// CHECK: ret i32 %[[add]]
|
|
return %p : i32
|
|
}
|
|
|
|
// CHECK-LABEL: @test
|
|
func.func @test(%a : i32, %b : i32, %c : i32) -> i32 {
|
|
// CHECK: %[[add:.*]] = add i32
|
|
%m = fir.call @add(%a, %b) : (i32, i32) -> i32
|
|
// CHECK: %[[mul:.*]] = mul i32 %[[add]],
|
|
%n = arith.muli %m, %c : i32
|
|
// CHECK: ret i32 %[[mul]]
|
|
return %n : i32
|
|
}
|