about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAntoni Boucher <bouanto@zoho.com>2025-01-12 09:36:12 -0500
committerAntoni Boucher <bouanto@zoho.com>2025-01-12 12:06:25 -0500
commit93f7f2fdeba33c748cbda750cdbaa2c80bb34be1 (patch)
treeee85a68af9e1c08e9d9d09bda64ad3bdddb05060
parentfe608c7639b0261232c5c00822f77fefe897425b (diff)
downloadrust-93f7f2fdeba33c748cbda750cdbaa2c80bb34be1.tar.gz
rust-93f7f2fdeba33c748cbda750cdbaa2c80bb34be1.zip
Add LTO test
-rw-r--r--.github/workflows/release.yml5
-rw-r--r--tests/hello-world/Cargo.toml3
2 files changed, 8 insertions, 0 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 887720436e9..f1ddb301acc 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -71,3 +71,8 @@ jobs:
         # FIXME(antoyo): we cannot enable LTO for stdarch tests currently because of some failing LTO tests using proc-macros.
         echo -n 'lto = "fat"' >> build_system/build_sysroot/Cargo.toml
         EMBED_LTO_BITCODE=1 ./y.sh test --release --clean --release-sysroot --build-sysroot --keep-lto-tests ${{ matrix.commands }}
+
+    - name: Run y.sh cargo build
+      run: |
+        EMBED_LTO_BITCODE=1 CHANNEL="release" ./y.sh cargo build --release --manifest-path tests/hello-world/Cargo.toml
+        # TODO: grep the asm output for "call my_func" and fail if it is found.
diff --git a/tests/hello-world/Cargo.toml b/tests/hello-world/Cargo.toml
index f73beedccce..c6e22f642f6 100644
--- a/tests/hello-world/Cargo.toml
+++ b/tests/hello-world/Cargo.toml
@@ -7,3 +7,6 @@ mylib = { path = "mylib" }
 
 [profile.dev]
 lto = "thin"
+
+[profile.release]
+lto = "fat"