diff options
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/CodeGen/WinEH/seh-catch-all.ll | 2 | ||||
-rw-r--r-- | llvm/test/CodeGen/WinEH/seh-inlined-finally.ll | 2 | ||||
-rw-r--r-- | llvm/test/CodeGen/WinEH/seh-outlined-finally.ll | 2 | ||||
-rw-r--r-- | llvm/test/CodeGen/WinEH/seh-prepared-basic.ll | 2 | ||||
-rw-r--r-- | llvm/test/CodeGen/WinEH/seh-simple.ll | 2 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/seh-basic.ll | 175 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/seh-catch-all.ll | 1 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/seh-except-finally.ll | 2 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/seh-finally.ll | 2 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/seh-safe-div.ll | 2 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/win_eh_prepare.ll | 2 |
11 files changed, 185 insertions, 9 deletions
diff --git a/llvm/test/CodeGen/WinEH/seh-catch-all.ll b/llvm/test/CodeGen/WinEH/seh-catch-all.ll index ab6c9effbf4..fb2b9ba7cfd 100644 --- a/llvm/test/CodeGen/WinEH/seh-catch-all.ll +++ b/llvm/test/CodeGen/WinEH/seh-catch-all.ll @@ -1,4 +1,4 @@ -; RUN: opt -S -winehprepare < %s | FileCheck %s +; RUN: opt -S -winehprepare -sehprepare < %s | FileCheck %s target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-windows-msvc" diff --git a/llvm/test/CodeGen/WinEH/seh-inlined-finally.ll b/llvm/test/CodeGen/WinEH/seh-inlined-finally.ll index d2080cff79d..54045f8d9f1 100644 --- a/llvm/test/CodeGen/WinEH/seh-inlined-finally.ll +++ b/llvm/test/CodeGen/WinEH/seh-inlined-finally.ll @@ -1,4 +1,4 @@ -; RUN: opt -S -winehprepare < %s | FileCheck %s +; RUN: opt -S -winehprepare -sehprepare < %s | FileCheck %s ; Check that things work when the mid-level optimizer inlines the finally ; block. diff --git a/llvm/test/CodeGen/WinEH/seh-outlined-finally.ll b/llvm/test/CodeGen/WinEH/seh-outlined-finally.ll index 19558b70530..bc9d3221ad4 100644 --- a/llvm/test/CodeGen/WinEH/seh-outlined-finally.ll +++ b/llvm/test/CodeGen/WinEH/seh-outlined-finally.ll @@ -1,4 +1,4 @@ -; RUN: opt -S -winehprepare -mtriple=x86_64-windows-msvc < %s | FileCheck %s +; RUN: opt -S -winehprepare -sehprepare -mtriple=x86_64-windows-msvc < %s | FileCheck %s ; Test case based on this code: ; diff --git a/llvm/test/CodeGen/WinEH/seh-prepared-basic.ll b/llvm/test/CodeGen/WinEH/seh-prepared-basic.ll index 880bb3c33a8..0c6850a972b 100644 --- a/llvm/test/CodeGen/WinEH/seh-prepared-basic.ll +++ b/llvm/test/CodeGen/WinEH/seh-prepared-basic.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s | FileCheck %s +; RUN: llc -sehprepare < %s | FileCheck %s ; Test case based on this code: ; extern "C" unsigned long _exception_code(); diff --git a/llvm/test/CodeGen/WinEH/seh-simple.ll b/llvm/test/CodeGen/WinEH/seh-simple.ll index a2a2139c270..6d9ee1c4f07 100644 --- a/llvm/test/CodeGen/WinEH/seh-simple.ll +++ b/llvm/test/CodeGen/WinEH/seh-simple.ll @@ -1,4 +1,4 @@ -; RUN: opt -S -winehprepare -mtriple=x86_64-windows-msvc < %s | FileCheck %s +; RUN: opt -S -winehprepare -sehprepare -mtriple=x86_64-windows-msvc < %s | FileCheck %s target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-windows-msvc" diff --git a/llvm/test/CodeGen/X86/seh-basic.ll b/llvm/test/CodeGen/X86/seh-basic.ll new file mode 100644 index 00000000000..69d70d70948 --- /dev/null +++ b/llvm/test/CodeGen/X86/seh-basic.ll @@ -0,0 +1,175 @@ +; RUN: llc -mtriple x86_64-pc-windows-msvc < %s | FileCheck %s + +define void @two_invoke_merged() { +entry: + invoke void @try_body() + to label %again unwind label %lpad + +again: + invoke void @try_body() + to label %done unwind label %lpad + +done: + ret void + +lpad: + %vals = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) + catch i8* bitcast (i32 (i8*, i8*)* @filt0 to i8*) + catch i8* bitcast (i32 (i8*, i8*)* @filt1 to i8*) + %sel = extractvalue { i8*, i32 } %vals, 1 + call void @use_selector(i32 %sel) + ret void +} + +; Normal path code + +; CHECK-LABEL: {{^}}two_invoke_merged: +; CHECK: .seh_proc two_invoke_merged +; CHECK: .seh_handler __C_specific_handler, @unwind, @except +; CHECK: .Ltmp0: +; CHECK: callq try_body +; CHECK-NEXT: .Ltmp1: +; CHECK: .Ltmp2: +; CHECK: callq try_body +; CHECK-NEXT: .Ltmp3: +; CHECK: retq + +; Landing pad code + +; CHECK: .Ltmp5: +; CHECK: movl $1, %ecx +; CHECK: jmp +; CHECK: .Ltmp6: +; CHECK: movl $2, %ecx +; CHECK: callq use_selector + +; CHECK: .seh_handlerdata +; CHECK-NEXT: .long 2 +; CHECK-NEXT: .long .Ltmp0@IMGREL +; CHECK-NEXT: .long .Ltmp3@IMGREL+1 +; CHECK-NEXT: .long filt0@IMGREL +; CHECK-NEXT: .long .Ltmp5@IMGREL +; CHECK-NEXT: .long .Ltmp0@IMGREL +; CHECK-NEXT: .long .Ltmp3@IMGREL+1 +; CHECK-NEXT: .long filt1@IMGREL +; CHECK-NEXT: .long .Ltmp6@IMGREL +; CHECK: .text +; CHECK: .seh_endproc + +define void @two_invoke_gap() { +entry: + invoke void @try_body() + to label %again unwind label %lpad + +again: + call void @do_nothing_on_unwind() + invoke void @try_body() + to label %done unwind label %lpad + +done: + ret void + +lpad: + %vals = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) + catch i8* bitcast (i32 (i8*, i8*)* @filt0 to i8*) + %sel = extractvalue { i8*, i32 } %vals, 1 + call void @use_selector(i32 %sel) + ret void +} + +; Normal path code + +; CHECK-LABEL: {{^}}two_invoke_gap: +; CHECK: .seh_proc two_invoke_gap +; CHECK: .seh_handler __C_specific_handler, @unwind, @except +; CHECK: .Ltmp11: +; CHECK: callq try_body +; CHECK-NEXT: .Ltmp12: +; CHECK: callq do_nothing_on_unwind +; CHECK: .Ltmp13: +; CHECK: callq try_body +; CHECK-NEXT: .Ltmp14: +; CHECK: retq + +; Landing pad code + +; CHECK: .Ltmp16: +; CHECK: movl $1, %ecx +; CHECK: callq use_selector + +; CHECK: .seh_handlerdata +; CHECK-NEXT: .long 2 +; CHECK-NEXT: .long .Ltmp11@IMGREL +; CHECK-NEXT: .long .Ltmp12@IMGREL+1 +; CHECK-NEXT: .long filt0@IMGREL +; CHECK-NEXT: .long .Ltmp16@IMGREL +; CHECK-NEXT: .long .Ltmp13@IMGREL +; CHECK-NEXT: .long .Ltmp14@IMGREL+1 +; CHECK-NEXT: .long filt0@IMGREL +; CHECK-NEXT: .long .Ltmp16@IMGREL +; CHECK: .text +; CHECK: .seh_endproc + +define void @two_invoke_nounwind_gap() { +entry: + invoke void @try_body() + to label %again unwind label %lpad + +again: + call void @cannot_unwind() + invoke void @try_body() + to label %done unwind label %lpad + +done: + ret void + +lpad: + %vals = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) + catch i8* bitcast (i32 (i8*, i8*)* @filt0 to i8*) + %sel = extractvalue { i8*, i32 } %vals, 1 + call void @use_selector(i32 %sel) + ret void +} + +; Normal path code + +; CHECK-LABEL: {{^}}two_invoke_nounwind_gap: +; CHECK: .seh_proc two_invoke_nounwind_gap +; CHECK: .seh_handler __C_specific_handler, @unwind, @except +; CHECK: .Ltmp21: +; CHECK: callq try_body +; CHECK-NEXT: .Ltmp22: +; CHECK: callq cannot_unwind +; CHECK: .Ltmp23: +; CHECK: callq try_body +; CHECK-NEXT: .Ltmp24: +; CHECK: retq + +; Landing pad code + +; CHECK: .Ltmp26: +; CHECK: movl $1, %ecx +; CHECK: callq use_selector + +; CHECK: .seh_handlerdata +; CHECK-NEXT: .long 1 +; CHECK-NEXT: .long .Ltmp21@IMGREL +; CHECK-NEXT: .long .Ltmp24@IMGREL+1 +; CHECK-NEXT: .long filt0@IMGREL +; CHECK-NEXT: .long .Ltmp26@IMGREL +; CHECK: .text +; CHECK: .seh_endproc + +declare void @try_body() +declare void @do_nothing_on_unwind() +declare void @cannot_unwind() nounwind +declare void @use_selector(i32) + +declare i32 @filt0(i8* %eh_info, i8* %rsp) +declare i32 @filt1(i8* %eh_info, i8* %rsp) + +declare void @handler0() +declare void @handler1() + +declare i32 @__C_specific_handler(...) +declare i32 @llvm.eh.typeid.for(i8*) readnone nounwind diff --git a/llvm/test/CodeGen/X86/seh-catch-all.ll b/llvm/test/CodeGen/X86/seh-catch-all.ll index 931046e5115..a224da5638b 100644 --- a/llvm/test/CodeGen/X86/seh-catch-all.ll +++ b/llvm/test/CodeGen/X86/seh-catch-all.ll @@ -1,3 +1,4 @@ +; RUN: llc -sehprepare -mtriple=x86_64-windows-msvc < %s | FileCheck %s ; RUN: llc -mtriple=x86_64-windows-msvc < %s | FileCheck %s @str = internal unnamed_addr constant [10 x i8] c"recovered\00", align 1 diff --git a/llvm/test/CodeGen/X86/seh-except-finally.ll b/llvm/test/CodeGen/X86/seh-except-finally.ll index c796f1ef288..42f7d729c1b 100644 --- a/llvm/test/CodeGen/X86/seh-except-finally.ll +++ b/llvm/test/CodeGen/X86/seh-except-finally.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s | FileCheck %s +; RUN: llc -sehprepare < %s | FileCheck %s ; Test case based on this source: ; int puts(const char*); diff --git a/llvm/test/CodeGen/X86/seh-finally.ll b/llvm/test/CodeGen/X86/seh-finally.ll index 91baed570f2..e6d1f1b1a76 100644 --- a/llvm/test/CodeGen/X86/seh-finally.ll +++ b/llvm/test/CodeGen/X86/seh-finally.ll @@ -1,4 +1,4 @@ -; RUN: llc -mtriple=x86_64-windows-msvc < %s | FileCheck %s +; RUN: llc -sehprepare -mtriple=x86_64-windows-msvc < %s | FileCheck %s @str_recovered = internal unnamed_addr constant [10 x i8] c"recovered\00", align 1 diff --git a/llvm/test/CodeGen/X86/seh-safe-div.ll b/llvm/test/CodeGen/X86/seh-safe-div.ll index 80b15b60102..1f9e22c5462 100644 --- a/llvm/test/CodeGen/X86/seh-safe-div.ll +++ b/llvm/test/CodeGen/X86/seh-safe-div.ll @@ -1,4 +1,4 @@ -; RUN: llc -mtriple x86_64-pc-windows-msvc < %s | FileCheck %s +; RUN: llc -sehprepare -mtriple x86_64-pc-windows-msvc < %s | FileCheck %s ; This test case is also intended to be run manually as a complete functional ; test. It should link, print something, and exit zero rather than crashing. diff --git a/llvm/test/CodeGen/X86/win_eh_prepare.ll b/llvm/test/CodeGen/X86/win_eh_prepare.ll index a33dd92ad72..3e513e072ea 100644 --- a/llvm/test/CodeGen/X86/win_eh_prepare.ll +++ b/llvm/test/CodeGen/X86/win_eh_prepare.ll @@ -1,4 +1,4 @@ -; RUN: opt -S -winehprepare -dwarfehprepare -mtriple x86_64-pc-windows-msvc < %s | FileCheck %s +; RUN: opt -S -winehprepare -sehprepare -dwarfehprepare -mtriple x86_64-pc-windows-msvc < %s | FileCheck %s ; FIXME: Add and test outlining here. |