[flang-commits] [flang] [Flang][Driver] Emit module summary for LTO (PR #164302)

Tarun Prabhu via flang-commits flang-commits at lists.llvm.org
Mon Oct 20 18:00:26 PDT 2025


================
@@ -1,21 +1,35 @@
 ! Test that the output is LLVM bitcode for LTO and not a native objectfile by
-! disassembling it to LLVM IR.
-! Right now there is nothing special about it and it is similar to non-lto IR,
-! more work is needed to add things like module summaries.
+! disassembling it to LLVM IR. Also tests module summaries are emitted for LTO
 
 ! RUN: %flang %s -c -o - | not llvm-dis -o %t
 ! RUN: %flang_fc1 %s -emit-llvm-bc -o - | llvm-dis -o - | FileCheck %s
-
-! RUN: %flang -flto %s -c -o - | llvm-dis -o - | FileCheck %s
-! RUN: %flang -flto=thin %s -c -o - | llvm-dis -o - | FileCheck %s
-
 ! CHECK: define void @_QQmain()
 ! CHECK-NEXT:  ret void
 ! CHECK-NEXT: }
+! CHECK-NOT: !{{.*}} = !{i32 1, !"ThinLTO", i32 0}
+! CHECK-NOT: ^{{.*}} = module:
+! CHECK-NOT: ^{{.*}} = gv: (name:
+! CHECK-NOT: ^{{.*}} = blockcount:
+
+! RUN: %flang -flto %s -c -o - | llvm-dis -o - | FileCheck %s --check-prefix=FULL
----------------
tarunprabhu wrote:

Could you swap this and line 23. This one contains `--check-prefix=FULL`, but what follow are the `THIN` prefixes. On line 23, `--check-prefix=THIN` is used, but it is followed by the `FULL` prefixes on line 24 onwards.

https://github.com/llvm/llvm-project/pull/164302


More information about the flang-commits mailing list