[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / llvm / test / CodeGen / AMDGPU / stacksave_stackrestore.invalid.ll
blob13dcaaf35132aaaa93bce9452a004666304b29ed
1 ; RUN: split-file %s %t
2 ; 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 %s
3 ; 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 %s
5 ; RUN: not --crash llc -global-isel=1 -mtriple=amdgcn-amd-amdpal -mcpu=gfx1030 -filetype=null %t/stacksave-error.ll 2>&1 | FileCheck -check-prefix=ERR-SAVE-GISEL %s
6 ; RUN: not --crash llc -global-isel=1 -mtriple=amdgcn-amd-amdpal -mcpu=gfx1030 -filetype=null %t/stackrestore-error.ll 2>&1 | FileCheck -check-prefix=ERR-RESTORE-GISEL %s
8 ; Test that an error is produced if stacksave/stackrestore are used
9 ; with the wrong (default) address space.
11 ;--- stacksave-error.ll
13 declare ptr @llvm.stacksave.p0()
15 ; ERR-SAVE-SDAG: LLVM ERROR: Cannot select: {{.+}}: i64,ch = stacksave
16 ; ERR-SAVE-GISEL: LLVM ERROR: unable to legalize instruction: %{{[0-9]+}}:_(p0) = G_STACKSAVE (in function: func_store_stacksave)
17 define void @func_store_stacksave() {
18   %stacksave = call ptr @llvm.stacksave.p0()
19   call void asm sideeffect "; use $0", "s"(ptr %stacksave)
20   ret void
23 ;--- stackrestore-error.ll
25 declare void @llvm.stackrestore.p0(ptr)
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)
29 define amdgpu_gfx void @func_stacksave_sgpr(ptr inreg %stack) {
30   call void @llvm.stackrestore.p0(ptr %stack)
31   ret void