xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/x32-landingpad.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1; RUN: llc < %s -mtriple=x86_64-none-none-gnux32 -mcpu=generic | FileCheck %s
2; RUN: llc < %s -mtriple=x86_64-none-none-gnux32 -mcpu=generic -fast-isel | FileCheck %s
3;
4; Ensures that landingpad instructions in x32 use the right Exception Pointer
5; and Exception Selector registers.
6
7declare void @foo()
8declare void @bar(i8*, i32) noreturn
9declare i32 @__gxx_personality_v0(...)
10
11define void @test1() uwtable personality i32 (...)* @__gxx_personality_v0 {
12entry:
13  invoke void @foo() to label %done unwind label %lpad
14done:
15  ret void
16lpad:
17  %0 = landingpad { i8*, i32 } cleanup
18; The Exception Pointer is %eax; the Exception Selector, %edx.
19; CHECK: LBB{{[^%]*}} %lpad
20; CHECK-DAG: movl %eax, {{.*}}
21; CHECK-DAG: movl %edx, {{.*}}
22; CHECK: callq bar
23  %1 = extractvalue { i8*, i32 } %0, 0
24  %2 = extractvalue { i8*, i32 } %0, 1
25  call void @bar(i8* %1, i32 %2)
26  unreachable
27}
28