================
@@ -0,0 +1,22 @@
+! Check that -flto=thin without -fsplit-lto-unit has EnableSplitLTOUnit = 0
+! RUN: %flang -flto=thin  -S -emit-llvm -o - %s |  FileCheck %s
+! RUN: %flang -flto=thin -S -emit-llvm -o - %s |  FileCheck %s
+! RUN: %flang -flto=thin --target=x86_64-linux-gnu -emit-llvm -S -o - %s |  
FileCheck %s
+! CHECK: !{i32 1, !"EnableSplitLTOUnit", i32 0}
+!
+! Check that -flto=thin with -fsplit-lto-unit has EnableSplitLTOUnit = 1
+! RUN: %flang -flto=thin -fsplit-lto-unit -emit-llvm -S -o - %s | FileCheck %s 
--check-prefix=SPLIT
+! RUN: %flang -flto=thin --target=x86_64-linux-gnu -fsplit-lto-unit -emit-llvm 
-S -o - %s | FileCheck %s --check-prefix=SPLIT
+! SPLIT: !{i32 1, !"EnableSplitLTOUnit", i32 1}
+!
+! Check that regular LTO has EnableSplitLTOUnit = 1
+! RUN: %flang -flto -emit-llvm -S -o - %s | FileCheck %s 
--implicit-check-not="EnableSplitLTOUnit" --check-prefix=SPLIT
+! RUN: %flang -flto --target=x86_64-linux-gnu -emit-llvm -S  -o - %s |  
FileCheck %s --implicit-check-not="EnableSplitLTOUnit" --check-prefix=SPLIT
+
+! Check that regular LTO has no EnableSplitLTOUnit = 1 for apple targets
----------------
shivaramaarao wrote:

For thinLTO on apple targets, the behavior is same as x86_64. with 
-fsplit-lto-unit option, EnableSplitLTOUnit will be 1 and without the option, 
EnableSplitLTOUnit will be 0.
for fullLTO, we are not emitting EnableSplitUnit=0 for apple targets by 
default. EnableSplitUnit=0 is emitted for non apple targets. The behavior is 
similar to clang. 

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

Reply via email to