1 ; Test that the printf library call simplifier works correctly.
3 ; RUN: opt < %s -passes=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 ptr @__CxxFrameHandler3 {
12 invoke void @_CxxThrowException(ptr null, ptr null)
13 to label %unreachable unwind label %catch.dispatch
16 %cs = catchswitch within none [label %catch] unwind to caller
19 %cp = catchpad within %cs [ptr null, i32 64, ptr null]
20 %call = call i32 (ptr, ...) @printf(ptr @.str) [ "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]] [ptr null, i32 64, ptr null]
33 ; CHECK: call i32 @putchar(i32 10) [ "funclet"(token %[[CP]]) ]
35 declare void @_CxxThrowException(ptr, ptr)
37 declare i32 @__CxxFrameHandler3(...)
39 declare i32 @printf(ptr, ...)