33 lines · plain
1; RUN: split-file %s %t2; RUN: not --crash llc -global-isel=0 -mtriple=amdgcn-amd-amdpal -mcpu=gfx1030 -filetype=null %t/stacksave-error.ll 2>&1 | FileCheck -check-prefix=ERR-SAVE-SDAG %s3; RUN: not --crash llc -global-isel=0 -mtriple=amdgcn-amd-amdpal -mcpu=gfx1030 -filetype=null %t/stackrestore-error.ll 2>&1 | FileCheck -check-prefix=ERR-RESTORE-SDAG %s4 5; RUN: not llc -global-isel=1 -mtriple=amdgcn-amd-amdpal -mcpu=gfx1030 -filetype=null %t/stacksave-error.ll 2>&1 | FileCheck -check-prefix=ERR-SAVE-GISEL %s6; RUN: not llc -global-isel=1 -mtriple=amdgcn-amd-amdpal -mcpu=gfx1030 -filetype=null %t/stackrestore-error.ll 2>&1 | FileCheck -check-prefix=ERR-RESTORE-GISEL %s7 8; Test that an error is produced if stacksave/stackrestore are used9; with the wrong (default) address space.10 11;--- stacksave-error.ll12 13declare ptr @llvm.stacksave.p0()14 15; ERR-SAVE-SDAG: LLVM ERROR: Cannot select: {{.+}}: i64,ch = stacksave16; ERR-SAVE-GISEL: LLVM ERROR: unable to legalize instruction: %{{[0-9]+}}:_(p0) = G_STACKSAVE (in function: func_store_stacksave)17define void @func_store_stacksave() {18 %stacksave = call ptr @llvm.stacksave.p0()19 call void asm sideeffect "; use $0", "s"(ptr %stacksave)20 ret void21}22 23;--- stackrestore-error.ll24 25declare void @llvm.stackrestore.p0(ptr)26 27; ERR-RESTORE-SDAG: LLVM ERROR: Cannot select: {{.+}}: ch = stackrestore {{.+}}, {{.+}}28; ERR-RESTORE-GISEL: LLVM ERROR: unable to legalize instruction: G_STACKRESTORE %{{[0-9]+}}:_(p0) (in function: func_stacksave_sgpr)29define amdgpu_gfx void @func_stacksave_sgpr(ptr inreg %stack) {30 call void @llvm.stackrestore.p0(ptr %stack)31 ret void32}33