File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ //@ revisions: enable-backchain disable-backchain
2+ //@ assembly-output: emit-asm
3+ //@ compile-flags: -O --crate-type=lib --target=s390x-unknown-linux-gnu
4+ //@ needs-llvm-components: systemz
5+ //@[enable-backchain] compile-flags: -Ctarget-feature=+backchain
6+ //@[disable-backchain] compile-flags: -Ctarget-feature=-backchain
7+ #![ feature( no_core, lang_items) ]
8+ #![ no_std]
9+ #![ no_core]
10+
11+ #[ lang = "sized" ]
12+ trait Sized { }
13+
14+ extern "C" {
15+ fn extern_func ( ) ;
16+ }
17+
18+ // CHECK-LABEL: test_backchain
19+ #[ no_mangle]
20+ extern "C" fn test_backchain ( ) -> i32 {
21+ // enable-backchain: lgr [[REG1:.*]], %r15
22+ // enable-backchain-NEXT: aghi %r15, -160
23+ // enable-backchain: stg [[REG1]], 0(%r15)
24+ // disable-backchain: aghi %r15, -160
25+ // disable-backchain-NOT: stg %r{{.*}}, 0(%r15)
26+ unsafe {
27+ extern_func ( ) ;
28+ }
29+ // enable-backchain-NEXT: brasl %r{{.*}}, extern_func@PLT
30+ // enable-backchain-NEXT: lghi %r2, 1
31+ // disable-backchain: lghi %r2, 0
32+ #[ cfg( target_feature = "backchain" ) ]
33+ {
34+ 1
35+ }
36+ #[ cfg( not( target_feature = "backchain" ) ) ]
37+ {
38+ 0
39+ }
40+ // CHECK: br %r{{.*}}
41+ }
You can’t perform that action at this time.
0 commit comments