Use Twin instead of std::to_string.
[oota-llvm.git] / test / CodeGen / X86 / tail-merge-wineh.ll
1 ; RUN: llc < %s | FileCheck %s
2
3 ; Started from this code:
4 ; void f() {
5 ;   try {
6 ;     try {
7 ;       throw 42;
8 ;     } catch (int) {
9 ;     }
10 ;     try {
11 ;       throw 42;
12 ;     } catch (int) {
13 ;     }
14 ;   } catch (int) {
15 ;   }
16 ; }
17
18 ; Don't tail merge the calls.
19 ; CHECK: calll __CxxThrowException@8
20 ; CHECK: calll __CxxThrowException@8
21
22 ; ModuleID = 'cppeh-pingpong.cpp'
23 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
24 target triple = "i686-pc-windows-msvc"
25
26 %rtti.TypeDescriptor2 = type { i8**, i8*, [3 x i8] }
27 %eh.CatchableType = type { i32, i8*, i32, i32, i32, i32, i8* }
28 %eh.CatchableTypeArray.1 = type { i32, [1 x %eh.CatchableType*] }
29 %eh.ThrowInfo = type { i32, i8*, i8*, i8* }
30
31 $"\01??_R0H@8" = comdat any
32
33 $"_CT??_R0H@84" = comdat any
34
35 $_CTA1H = comdat any
36
37 $_TI1H = comdat any
38
39 @"\01??_7type_info@@6B@" = external constant i8*
40 @"\01??_R0H@8" = linkonce_odr global %rtti.TypeDescriptor2 { i8** @"\01??_7type_info@@6B@", i8* null, [3 x i8] c".H\00" }, comdat
41 @"_CT??_R0H@84" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 0, i32 -1, i32 0, i32 4, i8* null }, section ".xdata", comdat
42 @_CTA1H = linkonce_odr unnamed_addr constant %eh.CatchableTypeArray.1 { i32 1, [1 x %eh.CatchableType*] [%eh.CatchableType* @"_CT??_R0H@84"] }, section ".xdata", comdat
43 @_TI1H = linkonce_odr unnamed_addr constant %eh.ThrowInfo { i32 0, i8* null, i8* null, i8* bitcast (%eh.CatchableTypeArray.1* @_CTA1H to i8*) }, section ".xdata", comdat
44
45 define void @"\01?f@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
46 entry:
47   %i = alloca i32, align 4
48   %tmp = alloca i32, align 4
49   %tmp1 = alloca i32, align 4
50   store i32 0, i32* %i, align 4
51   store i32 42, i32* %tmp, align 4
52   %0 = bitcast i32* %tmp to i8*
53   invoke void @_CxxThrowException(i8* %0, %eh.ThrowInfo* @_TI1H) #1
54           to label %unreachable unwind label %catch.dispatch
55
56 catch.dispatch:                                   ; preds = %entry
57   %1 = catchpad [%rtti.TypeDescriptor2* @"\01??_R0H@8", i32 0, i8* null]
58           to label %catch unwind label %catchendblock
59
60 catch:                                            ; preds = %catch.dispatch
61   catchret %1 to label %catchret.dest
62
63 catchret.dest:                                    ; preds = %catch
64   br label %try.cont
65
66 try.cont:                                         ; preds = %catchret.dest
67   store i32 42, i32* %tmp1, align 4
68   %2 = bitcast i32* %tmp1 to i8*
69   invoke void @_CxxThrowException(i8* %2, %eh.ThrowInfo* @_TI1H) #1
70           to label %unreachable unwind label %catch.dispatch.2
71
72 catch.dispatch.2:                                 ; preds = %try.cont
73   %3 = catchpad [%rtti.TypeDescriptor2* @"\01??_R0H@8", i32 0, i8* null]
74           to label %catch.4 unwind label %catchendblock.3
75
76 catch.4:                                          ; preds = %catch.dispatch.2
77   catchret %3 to label %catchret.dest.5
78
79 catchret.dest.5:                                  ; preds = %catch.4
80   br label %try.cont.6
81
82 try.cont.6:                                       ; preds = %catchret.dest.5
83   br label %try.cont.11
84
85 catchendblock.3:                                  ; preds = %catch.dispatch.2
86   catchendpad unwind label %catch.dispatch.7
87
88 catch.dispatch.7:                                 ; preds = %catchendblock.3, %catchendblock
89   %4 = catchpad [%rtti.TypeDescriptor2* @"\01??_R0H@8", i32 0, i8* null]
90           to label %catch.9 unwind label %catchendblock.8
91
92 catch.9:                                          ; preds = %catch.dispatch.7
93   catchret %4 to label %catchret.dest.10
94
95 catchret.dest.10:                                 ; preds = %catch.9
96   br label %try.cont.11
97
98 try.cont.11:                                      ; preds = %catchret.dest.10, %try.cont.6
99   ret void
100
101 catchendblock.8:                                  ; preds = %catch.dispatch.7
102   catchendpad unwind to caller
103
104 catchendblock:                                    ; preds = %catch.dispatch
105   catchendpad unwind label %catch.dispatch.7
106
107 unreachable:                                      ; preds = %try.cont, %entry
108   unreachable
109 }
110
111 declare x86_stdcallcc void @_CxxThrowException(i8*, %eh.ThrowInfo*)
112
113 declare i32 @__CxxFrameHandler3(...)
114
115 attributes #0 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
116 attributes #1 = { noreturn }