Skip to content

Commit fe608c7

Browse files
committed
Add ThinLTO test
1 parent 37a9e50 commit fe608c7

File tree

6 files changed

+43
-1
lines changed

6 files changed

+43
-1
lines changed

tests/hello-world/Cargo.lock

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/hello-world/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
[package]
22
name = "hello_world"
3+
edition = "2024"
34

45
[dependencies]
6+
mylib = { path = "mylib" }
7+
8+
[profile.dev]
9+
lto = "thin"

tests/hello-world/mylib/Cargo.lock

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/hello-world/mylib/Cargo.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[package]
2+
name = "mylib"
3+
version = "0.1.0"
4+
authors = ["Antoni Boucher <bouanto@zoho.com>"]
5+
edition = "2018"
6+
7+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8+
9+
[dependencies]

tests/hello-world/mylib/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pub fn my_func(a: i32, b: i32) -> i32 {
2+
let mut res = a;
3+
for i in a..b {
4+
res += i;
5+
}
6+
res
7+
}

tests/hello-world/src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use mylib::my_func;
2+
13
fn main() {
2-
println!("Hello, world!");
4+
println!("{}", my_func(5, 10));
35
}

0 commit comments

Comments
 (0)