================
@@ -0,0 +1,14 @@
+// RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s
+
+// CHECK: define void @disable_tail_calls() #[[ATTRS_TRUE:.*]] {
+llvm.func @disable_tail_calls() attributes {disable_tail_calls = true} {
+  llvm.return
+}
+
+// CHECK: define void @disable_tail_calls_false() #[[ATTRS_FALSE:.*]] {
+llvm.func @disable_tail_calls_false() attributes {disable_tail_calls = false} {
----------------
kaviya2510 wrote:

Clang does not emit `disable-tail-calls=false` with `-foptimize-sibling-calls`. 
it emits the attribute only when tail-call optimization is explicitly disabled 
through `-fno-optimize-siblings-calls` and flang has the same behavior as clang.

The `"disable_tail_calls = false"` case in this testcase only verifies the 
behavior when `disable_tail_calls = false` is explicitly specified in MLIR. The 
purpose of this test is to ensure that the LLVM dialect exposes the attribute 
and lowers it correctly to LLVM IR. 

https://github.com/llvm/llvm-project/pull/216650
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to