1 ; Test that the printf library call simplifier works correctly.
3 ; RUN: opt < %s -instcombine -S | FileCheck %s
5 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
6 target triple = "x86_64-pc-windows-msvc18.0.0"
8 @.str = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
10 define void @test1() personality i32 (...)* @__CxxFrameHandler3 {
12 invoke void @_CxxThrowException(i8* null, i8* null)
13 to label %unreachable unwind label %catch.dispatch
16 %cs = catchswitch within none [label %catch] unwind to caller
19 %cp = catchpad within %cs [i8* null, i32 64, i8* null]
20 %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0)) [ "funclet"(token %cp) ]
21 catchret from %cp to label %try.cont
30 ; CHECK-DAG: define void @test1(
31 ; CHECK: %[[CS:.*]] = catchswitch within none
32 ; CHECK: %[[CP:.*]] = catchpad within %[[CS]] [i8* null, i32 64, i8* null]
33 ; CHECK: call i32 @putchar(i32 10) [ "funclet"(token %[[CP]]) ]
35 declare void @_CxxThrowException(i8*, i8*)
37 declare i32 @__CxxFrameHandler3(...)
39 declare i32 @printf(i8*, ...)