1*9880d681SAndroid Build Coastguard Worker; RUN: opt -S -argpromotion < %s | FileCheck %s 2*9880d681SAndroid Build Coastguard Workertarget triple = "x86_64-pc-windows-msvc" 3*9880d681SAndroid Build Coastguard Worker 4*9880d681SAndroid Build Coastguard Workerdefine internal void @callee(i8*) { 5*9880d681SAndroid Build Coastguard Workerentry: 6*9880d681SAndroid Build Coastguard Worker call void @thunk() 7*9880d681SAndroid Build Coastguard Worker ret void 8*9880d681SAndroid Build Coastguard Worker} 9*9880d681SAndroid Build Coastguard Worker 10*9880d681SAndroid Build Coastguard Workerdefine void @test1() personality i32 (...)* @__CxxFrameHandler3 { 11*9880d681SAndroid Build Coastguard Workerentry: 12*9880d681SAndroid Build Coastguard Worker invoke void @thunk() 13*9880d681SAndroid Build Coastguard Worker to label %out unwind label %cpad 14*9880d681SAndroid Build Coastguard Worker 15*9880d681SAndroid Build Coastguard Workerout: 16*9880d681SAndroid Build Coastguard Worker ret void 17*9880d681SAndroid Build Coastguard Worker 18*9880d681SAndroid Build Coastguard Workercpad: 19*9880d681SAndroid Build Coastguard Worker %pad = cleanuppad within none [] 20*9880d681SAndroid Build Coastguard Worker call void @callee(i8* null) [ "funclet"(token %pad) ] 21*9880d681SAndroid Build Coastguard Worker cleanupret from %pad unwind to caller 22*9880d681SAndroid Build Coastguard Worker} 23*9880d681SAndroid Build Coastguard Worker 24*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: define void @test1( 25*9880d681SAndroid Build Coastguard Worker; CHECK: %[[pad:.*]] = cleanuppad within none [] 26*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: call void @callee() [ "funclet"(token %[[pad]]) ] 27*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: cleanupret from %[[pad]] unwind to caller 28*9880d681SAndroid Build Coastguard Worker 29*9880d681SAndroid Build Coastguard Workerdeclare void @thunk() 30*9880d681SAndroid Build Coastguard Worker 31*9880d681SAndroid Build Coastguard Workerdeclare i32 @__CxxFrameHandler3(...) 32