Skip to content

Commit 14ee503

Browse files
authored
Rollup merge of rust-lang#157475 - veluca93:optimize-smoke, r=jieyouxu
Add a smoke test for the optimize attribute. Tracking issue: rust-lang#54882 Stabilization PR: rust-lang#157273
2 parents f152629 + dfa5c7b commit 14ee503

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//! Basic smoke test for `#[optimize(..)]` attributes.
2+
//@ run-pass
3+
4+
#![feature(optimize_attribute)]
5+
6+
#[optimize(speed)]
7+
fn optimized_speed() -> i32 {
8+
42
9+
}
10+
11+
#[optimize(size)]
12+
fn optimized_size() -> i32 {
13+
42
14+
}
15+
16+
#[optimize(none)]
17+
fn optimized_none() -> i32 {
18+
42
19+
}
20+
21+
fn main() {
22+
assert_eq!(optimized_speed(), 42);
23+
assert_eq!(optimized_size(), 42);
24+
assert_eq!(optimized_none(), 42);
25+
}

0 commit comments

Comments
 (0)