Skip to content

Commit d62e21f

Browse files
committed
Broken test to show alwaysinline attribute not being applied
1 parent 34a8c73 commit d62e21f

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//@ add-core-stubs
2+
//@ compile-flags: --target aarch64-unknown-linux-gnu -Zinline-mir=no -C no-prepopulate-passes
3+
//@ needs-llvm-components: aarch64
4+
5+
#![crate_type = "lib"]
6+
#![feature(no_core, lang_items, target_feature_inline_always)]
7+
#![no_core]
8+
9+
extern crate minicore;
10+
use minicore::*;
11+
12+
#[inline(always)]
13+
#[target_feature(enable = "neon")]
14+
#[no_mangle]
15+
pub fn single_target_feature() -> i32 {
16+
42
17+
}
18+
19+
#[inline(always)]
20+
#[target_feature(enable = "neon,i8mm")]
21+
#[no_mangle]
22+
// CHECK: define noundef i32 @multiple_target_features() unnamed_addr #1 {
23+
pub fn multiple_target_features() -> i32 {
24+
// CHECK: %_0 = call noundef i32 @single_target_feature() #3
25+
single_target_feature()
26+
}
27+
28+
#[no_mangle]
29+
// CHECK: define noundef i32 @inherits_from_global() unnamed_addr #2 {
30+
pub fn inherits_from_global() -> i32 {
31+
unsafe {
32+
// CHECK: %_0 = call noundef i32 @single_target_feature() #3
33+
single_target_feature()
34+
}
35+
}
36+
37+
// CHECK: attributes #3 = { nounwind }

0 commit comments

Comments
 (0)