brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.9 KiB · 112031c Raw
75 lines · plain
1; RUN: llc < %s | FileCheck %s2 3; Generated with this C source:4; static __forceinline void __cpuid() { __asm__(""); }5; void f() {6;   __try {7;     __cpuid();8;   } __except (1) {9;   }10; }11 12; When running clang at -O1, we can end up deleting unreachable SEH catchpads13; without running GlobalDCE to remove the associated filter. This used to14; result in references to undefined labels. Now we check that we emit the15; label. This was PR30431.16 17; CHECK-LABEL: _f:                                     # @f18; CHECK: Lf$parent_frame_offset = 019; CHECK: retl20 21; CHECK-LABEL: "?filt$0@0@f@@":                        # @"\01?filt$0@0@f@@"22; CHECK: movl    $Lf$parent_frame_offset,23 24; ModuleID = 't.c'25source_filename = "t.c"26target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"27target triple = "i386-pc-windows-msvc19.0.24210"28 29define void @f() #0 personality ptr @_except_handler3 {30__try.cont:31  %__exception_code = alloca i32, align 432  call void (...) @llvm.localescape(ptr nonnull %__exception_code)33  call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"() #3, !srcloc !134  ret void35}36 37; Function Attrs: nounwind38define internal i32 @"\01?filt$0@0@f@@"() #1 {39entry:40  %0 = tail call ptr @llvm.frameaddress(i32 1)41  %1 = tail call ptr @llvm.eh.recoverfp(ptr @f, ptr %0)42  %2 = tail call ptr @llvm.localrecover(ptr @f, ptr %1, i32 0)43  %3 = getelementptr inbounds i8, ptr %0, i32 -2044  %4 = load ptr, ptr %3, align 445  %5 = getelementptr inbounds { ptr, ptr }, ptr %4, i32 0, i32 046  %6 = load ptr, ptr %5, align 447  %7 = load i32, ptr %6, align 448  store i32 %7, ptr %2, align 449  ret i32 150}51 52; Function Attrs: nounwind readnone53declare ptr @llvm.frameaddress(i32) #254 55; Function Attrs: nounwind readnone56declare ptr @llvm.eh.recoverfp(ptr, ptr) #257 58; Function Attrs: nounwind readnone59declare ptr @llvm.localrecover(ptr, ptr, i32) #260 61declare i32 @_except_handler3(...)62 63; Function Attrs: nounwind64declare void @llvm.localescape(...) #365 66attributes #0 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="pentium4" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }67attributes #1 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="pentium4" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }68attributes #2 = { nounwind readnone }69attributes #3 = { nounwind }70 71!llvm.ident = !{!0}72 73!0 = !{!"clang version 4.0.0 (trunk 282900) (llvm/trunk 282903)"}74!1 = !{i32 48}75