1; RUN: llc -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
2
3
4@_ZTIi = external constant i8*
5
6; Function is marked as nounwind but it still throws with __cxa_throw and
7; calls __cxa_call_unexpected.
8; Need to make sure that we do not only have a debug frame.
9; Function Attrs: noreturn nounwind
10define void @_Z4funcv() local_unnamed_addr #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
11entry:
12  %exception = tail call i8* @__cxa_allocate_exception(i64 4)
13  %0 = bitcast i8* %exception to i32*
14  store i32 100, i32* %0, align 16
15  invoke void @__cxa_throw(i8* %exception, i8* bitcast (i8** @_ZTIi to i8*), i8* null)
16          to label %unreachable unwind label %lpad
17
18lpad:                                             ; preds = %entry
19  %1 = landingpad { i8*, i32 }
20          filter [0 x i8*] zeroinitializer
21  %2 = extractvalue { i8*, i32 } %1, 0
22  tail call void @__cxa_call_unexpected(i8* %2)
23  unreachable
24
25unreachable:                                      ; preds = %entry
26  unreachable
27; CHECK-LABEL: _Z4funcv
28; CHECK-NOT: .debug_frame
29; CHECK: .cfi_personality
30; CHECK: .cfi_endproc
31}
32
33declare i8* @__cxa_allocate_exception(i64) local_unnamed_addr
34
35declare void @__cxa_throw(i8*, i8*, i8*) local_unnamed_addr
36
37declare i32 @__gxx_personality_v0(...)
38
39declare void @__cxa_call_unexpected(i8*) local_unnamed_addr
40
41
42attributes #0 = { noreturn 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-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
43
44