================
@@ -0,0 +1,13 @@
+// This test checks if Window PE file compiled with -flto option contains a 
magic 
+// string "LTCG" to indicate LTO compilation.
+
+// REQUIRES: system-windows
+
+// RUN: %clang --target=x86_64-pc-windows-msvc -flto -fuse-ld=lld %s -o %t.exe
----------------
mstorsjo wrote:

Yes, I understand that you’d want to test the full chain - that would be highly 
valuable, but that’s unfortunately generally much less portable, and doesn’t 
work as all these tools are in separate subprojects that are independent.

In clang you can have a test that runs clang on a C file and produces LLVM IR - 
you can check that the produced IR contains the relevant key elements. A LLVM 
test, if necessary (but I guess it isn’t necessary here), can compile the IR to 
an object file, and you can check that it contains the necessary bits. And in 
LLD, you can have the LTO test - you’d have LLVM IR that gets built into a 
bitcode object file (i.e. LTO object file), which you can link and check the 
output binary properties.

That kind of holistic tests would need to go in a separate subproject for 
end-to-end tests - we do have that I think, but I’m not sure how much it is 
used.

https://github.com/llvm/llvm-project/pull/114260
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to