1 ; RUN: llc < %s | FileCheck %s
3 ; Generated with this C source:
4 ; static __forceinline void __cpuid() { __asm__(""); }
12 ; When running clang at -O1, we can end up deleting unreachable SEH catchpads
13 ; without running GlobalDCE to remove the associated filter. This used to
14 ; result in references to undefined labels. Now we check that we emit the
15 ; label. This was PR30431.
17 ; CHECK-LABEL: _f: # @f
18 ; CHECK: .set Lf$parent_frame_offset, 0
21 ; CHECK-LABEL: "?filt$0@0@f@@": # @"\01?filt$0@0@f@@"
22 ; CHECK: movl $Lf$parent_frame_offset,
25 source_filename = "t.c"
26 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
27 target triple = "i386-pc-windows-msvc19.0.24210"
29 define void @f() #0 personality ptr @_except_handler3 {
31 %__exception_code = alloca i32, align 4
32 call void (...) @llvm.localescape(ptr nonnull %__exception_code)
33 call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"() #3, !srcloc !1
37 ; Function Attrs: nounwind
38 define internal i32 @"\01?filt$0@0@f@@"() #1 {
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 -20
44 %4 = load ptr, ptr %3, align 4
45 %5 = getelementptr inbounds { ptr, ptr }, ptr %4, i32 0, i32 0
46 %6 = load ptr, ptr %5, align 4
47 %7 = load i32, ptr %6, align 4
48 store i32 %7, ptr %2, align 4
52 ; Function Attrs: nounwind readnone
53 declare ptr @llvm.frameaddress(i32) #2
55 ; Function Attrs: nounwind readnone
56 declare ptr @llvm.eh.recoverfp(ptr, ptr) #2
58 ; Function Attrs: nounwind readnone
59 declare ptr @llvm.localrecover(ptr, ptr, i32) #2
61 declare i32 @_except_handler3(...)
63 ; Function Attrs: nounwind
64 declare void @llvm.localescape(...) #3
66 attributes #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" "unsafe-fp-math"="false" "use-soft-float"="false" }
67 attributes #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" "unsafe-fp-math"="false" "use-soft-float"="false" }
68 attributes #2 = { nounwind readnone }
69 attributes #3 = { nounwind }
73 !0 = !{!"clang version 4.0.0 (trunk 282900) (llvm/trunk 282903)"}