568 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 42 3; Test appropriate tagging of funclet for function calls generated by asan.4; RUN: opt -S -passes=asan,win-eh-prepare -asan-use-stack-safety=0 -asan-max-inline-poisoning-size=0 -asan-detect-invalid-pointer-cmp -asan-detect-invalid-pointer-sub -asan-use-after-scope < %s | FileCheck %s --check-prefixes=CHECK,CHECK-INLINE5; RUN: opt -S -passes=asan,win-eh-prepare -asan-use-stack-safety=0 -asan-max-inline-poisoning-size=0 -asan-instrumentation-with-call-threshold=0 -asan-detect-invalid-pointer-cmp -asan-detect-invalid-pointer-sub -asan-use-after-scope < %s | FileCheck %s --check-prefixes=CHECK,CHECK-OUTLINE6 7; REQUIRES: x86-registered-target8 9target triple = "x86_64-pc-windows-msvc"10 11declare void @DeInit(ptr)12declare void @MayThrowFunc()13declare void @NoReturn() noreturn14 15declare void @llvm.memmove.p0.p0.i64(ptr nocapture, ptr nocapture readonly, i64, i1)16declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1)17declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1)18declare void @llvm.lifetime.start.p0(i64, ptr nocapture) nounwind19declare void @llvm.lifetime.end.p0(i64, ptr nocapture) nounwind20 21declare i32 @__CxxFrameHandler3(...)22declare i32 @dummyPersonality(...)23 24define void @FuncletPersonality(ptr %ptrParam) sanitize_address personality ptr @__CxxFrameHandler3 {25; CHECK-INLINE-LABEL: define void @FuncletPersonality(26; CHECK-INLINE-SAME: ptr [[PTRPARAM:%.*]]) #[[ATTR2:[0-9]+]] personality ptr @__CxxFrameHandler3 {27; CHECK-INLINE-NEXT: entry:28; CHECK-INLINE-NEXT: [[TMP0:%.*]] = alloca i64, align 3229; CHECK-INLINE-NEXT: store i64 0, ptr [[TMP0]], align 830; CHECK-INLINE-NEXT: [[TMP1:%.*]] = load i64, ptr @__asan_shadow_memory_dynamic_address, align 831; CHECK-INLINE-NEXT: [[ASAN_LOCAL_STACK_BASE:%.*]] = alloca i64, align 832; CHECK-INLINE-NEXT: [[TMP2:%.*]] = load i32, ptr @__asan_option_detect_stack_use_after_return, align 433; CHECK-INLINE-NEXT: [[TMP3:%.*]] = icmp ne i32 [[TMP2]], 034; CHECK-INLINE-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP6:%.*]]35; CHECK-INLINE: 4:36; CHECK-INLINE-NEXT: [[TMP5:%.*]] = call i64 @__asan_stack_malloc_8(i64 8544)37; CHECK-INLINE-NEXT: br label [[TMP6]]38; CHECK-INLINE: 6:39; CHECK-INLINE-NEXT: [[TMP7:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[TMP5]], [[TMP4]] ]40; CHECK-INLINE-NEXT: [[TMP10:%.*]] = inttoptr i64 [[TMP7]] to ptr41; CHECK-INLINE-NEXT: [[TMP8:%.*]] = icmp eq i64 [[TMP7]], 042; CHECK-INLINE-NEXT: br i1 [[TMP8]], label [[TMP9:%.*]], label [[TMP11:%.*]]43; CHECK-INLINE: 10:44; CHECK-INLINE-NEXT: [[MYALLOCA:%.*]] = alloca i8, i64 8544, align 3245; CHECK-INLINE-NEXT: br label [[TMP11]]46; CHECK-INLINE: 11:47; CHECK-INLINE-NEXT: [[TMP23:%.*]] = phi ptr [ [[TMP10]], [[TMP6]] ], [ [[MYALLOCA]], [[TMP9]] ]48; CHECK-INLINE-NEXT: store ptr [[TMP23]], ptr [[ASAN_LOCAL_STACK_BASE]], align 849; CHECK-INLINE-NEXT: [[TMP14:%.*]] = getelementptr i8, ptr [[TMP23]], i64 3250; CHECK-INLINE-NEXT: [[TMP16:%.*]] = getelementptr i8, ptr [[TMP23]], i64 848051; CHECK-INLINE-NEXT: [[TMP18:%.*]] = getelementptr i8, ptr [[TMP23]], i64 849652; CHECK-INLINE-NEXT: [[TMP20:%.*]] = getelementptr i8, ptr [[TMP23]], i64 851253; CHECK-INLINE-NEXT: [[TMP22:%.*]] = getelementptr i8, ptr [[TMP23]], i64 852854; CHECK-INLINE-NEXT: store i64 1102416563, ptr [[TMP23]], align 855; CHECK-INLINE-NEXT: [[TMP25:%.*]] = getelementptr i8, ptr [[TMP23]], i64 856; CHECK-INLINE-NEXT: store i64 ptrtoint (ptr @___asan_gen_stack to i64), ptr [[TMP25]], align 857; CHECK-INLINE-NEXT: [[TMP27:%.*]] = getelementptr i8, ptr [[TMP23]], i64 1658; CHECK-INLINE-NEXT: store i64 ptrtoint (ptr @FuncletPersonality to i64), ptr [[TMP27]], align 859; CHECK-INLINE-NEXT: [[TMP12:%.*]] = ptrtoint ptr [[TMP23]] to i6460; CHECK-INLINE-NEXT: [[TMP28:%.*]] = lshr i64 [[TMP12]], 361; CHECK-INLINE-NEXT: [[TMP29:%.*]] = add i64 [[TMP28]], [[TMP1]]62; CHECK-INLINE-NEXT: call void @__asan_set_shadow_f1(i64 [[TMP29]], i64 4)63; CHECK-INLINE-NEXT: [[TMP30:%.*]] = add i64 [[TMP29]], 102864; CHECK-INLINE-NEXT: call void @__asan_set_shadow_f2(i64 [[TMP30]], i64 32)65; CHECK-INLINE-NEXT: [[TMP31:%.*]] = add i64 [[TMP29]], 106066; CHECK-INLINE-NEXT: call void @__asan_set_shadow_04(i64 [[TMP31]], i64 1)67; CHECK-INLINE-NEXT: [[TMP32:%.*]] = add i64 [[TMP29]], 106168; CHECK-INLINE-NEXT: call void @__asan_set_shadow_f2(i64 [[TMP32]], i64 1)69; CHECK-INLINE-NEXT: [[TMP33:%.*]] = add i64 [[TMP29]], 106270; CHECK-INLINE-NEXT: call void @__asan_set_shadow_04(i64 [[TMP33]], i64 1)71; CHECK-INLINE-NEXT: [[TMP34:%.*]] = add i64 [[TMP29]], 106372; CHECK-INLINE-NEXT: call void @__asan_set_shadow_f2(i64 [[TMP34]], i64 1)73; CHECK-INLINE-NEXT: [[TMP35:%.*]] = add i64 [[TMP29]], 106474; CHECK-INLINE-NEXT: call void @__asan_set_shadow_04(i64 [[TMP35]], i64 1)75; CHECK-INLINE-NEXT: [[TMP36:%.*]] = add i64 [[TMP29]], 106576; CHECK-INLINE-NEXT: call void @__asan_set_shadow_f2(i64 [[TMP36]], i64 1)77; CHECK-INLINE-NEXT: [[TMP37:%.*]] = add i64 [[TMP29]], 106678; CHECK-INLINE-NEXT: call void @__asan_set_shadow_f8(i64 [[TMP37]], i64 1)79; CHECK-INLINE-NEXT: [[TMP38:%.*]] = add i64 [[TMP29]], 106780; CHECK-INLINE-NEXT: call void @__asan_set_shadow_f3(i64 [[TMP38]], i64 1)81; CHECK-INLINE-NEXT: [[TMP39:%.*]] = add i64 [[TMP29]], 106682; CHECK-INLINE-NEXT: call void @__asan_set_shadow_04(i64 [[TMP39]], i64 1)83; CHECK-INLINE-NEXT: [[TMP21:%.*]] = ptrtoint ptr [[TMP22]] to i6484; CHECK-INLINE-NEXT: [[TMP40:%.*]] = lshr i64 [[TMP21]], 385; CHECK-INLINE-NEXT: [[TMP41:%.*]] = add i64 [[TMP40]], [[TMP1]]86; CHECK-INLINE-NEXT: [[TMP42:%.*]] = inttoptr i64 [[TMP41]] to ptr87; CHECK-INLINE-NEXT: [[TMP43:%.*]] = load i8, ptr [[TMP42]], align 188; CHECK-INLINE-NEXT: [[TMP44:%.*]] = icmp ne i8 [[TMP43]], 089; CHECK-INLINE-NEXT: br i1 [[TMP44]], label [[TMP45:%.*]], label [[TMP50:%.*]], !prof [[PROF1:![0-9]+]]90; CHECK-INLINE: 39:91; CHECK-INLINE-NEXT: [[TMP46:%.*]] = and i64 [[TMP21]], 792; CHECK-INLINE-NEXT: [[TMP47:%.*]] = trunc i64 [[TMP46]] to i893; CHECK-INLINE-NEXT: [[TMP48:%.*]] = icmp sge i8 [[TMP47]], [[TMP43]]94; CHECK-INLINE-NEXT: br i1 [[TMP48]], label [[TMP49:%.*]], label [[TMP50]]95; CHECK-INLINE: 43:96; CHECK-INLINE-NEXT: call void @__asan_report_store1(i64 [[TMP21]]) #[[ATTR7:[0-9]+]]97; CHECK-INLINE-NEXT: unreachable98; CHECK-INLINE: 44:99; CHECK-INLINE-NEXT: store volatile i8 0, ptr [[TMP22]], align 1100; CHECK-INLINE-NEXT: [[TMP51:%.*]] = add i64 [[TMP29]], 1066101; CHECK-INLINE-NEXT: call void @__asan_set_shadow_f8(i64 [[TMP51]], i64 1)102; CHECK-INLINE-NEXT: [[TMP52:%.*]] = alloca i8, i64 96, align 32103; CHECK-INLINE-NEXT: [[TMP53:%.*]] = ptrtoint ptr [[TMP52]] to i64104; CHECK-INLINE-NEXT: [[TMP54:%.*]] = add i64 [[TMP53]], 32105; CHECK-INLINE-NEXT: call void @__asan_alloca_poison(i64 [[TMP54]], i64 4)106; CHECK-INLINE-NEXT: [[TMP55:%.*]] = ptrtoint ptr [[TMP52]] to i64107; CHECK-INLINE-NEXT: store i64 [[TMP55]], ptr [[TMP0]], align 8108; CHECK-INLINE-NEXT: [[TMP56:%.*]] = inttoptr i64 [[TMP54]] to ptr109; CHECK-INLINE-NEXT: [[TMP57:%.*]] = alloca i8, i64 96, align 32110; CHECK-INLINE-NEXT: [[TMP58:%.*]] = ptrtoint ptr [[TMP57]] to i64111; CHECK-INLINE-NEXT: [[TMP59:%.*]] = add i64 [[TMP58]], 32112; CHECK-INLINE-NEXT: call void @__asan_alloca_poison(i64 [[TMP59]], i64 8)113; CHECK-INLINE-NEXT: [[TMP60:%.*]] = ptrtoint ptr [[TMP57]] to i64114; CHECK-INLINE-NEXT: store i64 [[TMP60]], ptr [[TMP0]], align 8115; CHECK-INLINE-NEXT: [[TMP61:%.*]] = inttoptr i64 [[TMP59]] to ptr116; CHECK-INLINE-NEXT: [[TMP62:%.*]] = lshr i64 [[TMP59]], 3117; CHECK-INLINE-NEXT: [[TMP63:%.*]] = add i64 [[TMP62]], [[TMP1]]118; CHECK-INLINE-NEXT: [[TMP64:%.*]] = inttoptr i64 [[TMP63]] to ptr119; CHECK-INLINE-NEXT: [[TMP65:%.*]] = load i8, ptr [[TMP64]], align 1120; CHECK-INLINE-NEXT: [[TMP66:%.*]] = icmp ne i8 [[TMP65]], 0121; CHECK-INLINE-NEXT: br i1 [[TMP66]], label [[TMP67:%.*]], label [[TMP68:%.*]]122; CHECK-INLINE: 61:123; CHECK-INLINE-NEXT: call void @__asan_report_store8(i64 [[TMP59]]) #[[ATTR7]]124; CHECK-INLINE-NEXT: unreachable125; CHECK-INLINE: 62:126; CHECK-INLINE-NEXT: store volatile i64 0, ptr [[TMP61]], align 8127; CHECK-INLINE-NEXT: [[TMPCOPYI64:%.*]] = load i64, ptr [[TMP61]], align 8128; CHECK-INLINE-NEXT: [[TMP69:%.*]] = and i64 [[TMPCOPYI64]], 31129; CHECK-INLINE-NEXT: [[TMP70:%.*]] = sub i64 32, [[TMP69]]130; CHECK-INLINE-NEXT: [[TMP71:%.*]] = icmp ne i64 [[TMP70]], 32131; CHECK-INLINE-NEXT: [[TMP72:%.*]] = select i1 [[TMP71]], i64 [[TMP70]], i64 0132; CHECK-INLINE-NEXT: [[TMP73:%.*]] = add i64 64, [[TMP72]]133; CHECK-INLINE-NEXT: [[TMP74:%.*]] = add i64 [[TMPCOPYI64]], [[TMP73]]134; CHECK-INLINE-NEXT: [[TMP75:%.*]] = alloca i8, i64 [[TMP74]], align 32135; CHECK-INLINE-NEXT: [[TMP76:%.*]] = ptrtoint ptr [[TMP75]] to i64136; CHECK-INLINE-NEXT: [[TMP77:%.*]] = add i64 [[TMP76]], 32137; CHECK-INLINE-NEXT: call void @__asan_alloca_poison(i64 [[TMP77]], i64 [[TMPCOPYI64]])138; CHECK-INLINE-NEXT: [[TMP78:%.*]] = ptrtoint ptr [[TMP75]] to i64139; CHECK-INLINE-NEXT: store i64 [[TMP78]], ptr [[TMP0]], align 8140; CHECK-INLINE-NEXT: [[TMP79:%.*]] = inttoptr i64 [[TMP77]] to ptr141; CHECK-INLINE-NEXT: [[TMP80:%.*]] = lshr i64 [[TMP77]], 3142; CHECK-INLINE-NEXT: [[TMP81:%.*]] = add i64 [[TMP80]], [[TMP1]]143; CHECK-INLINE-NEXT: [[TMP82:%.*]] = inttoptr i64 [[TMP81]] to ptr144; CHECK-INLINE-NEXT: [[TMP83:%.*]] = load i8, ptr [[TMP82]], align 1145; CHECK-INLINE-NEXT: [[TMP84:%.*]] = icmp ne i8 [[TMP83]], 0146; CHECK-INLINE-NEXT: br i1 [[TMP84]], label [[TMP85:%.*]], label [[TMP90:%.*]], !prof [[PROF1]]147; CHECK-INLINE: 79:148; CHECK-INLINE-NEXT: [[TMP86:%.*]] = and i64 [[TMP77]], 7149; CHECK-INLINE-NEXT: [[TMP87:%.*]] = trunc i64 [[TMP86]] to i8150; CHECK-INLINE-NEXT: [[TMP88:%.*]] = icmp sge i8 [[TMP87]], [[TMP83]]151; CHECK-INLINE-NEXT: br i1 [[TMP88]], label [[TMP89:%.*]], label [[TMP90]]152; CHECK-INLINE: 83:153; CHECK-INLINE-NEXT: call void @__asan_report_store1(i64 [[TMP77]]) #[[ATTR7]]154; CHECK-INLINE-NEXT: unreachable155; CHECK-INLINE: 84:156; CHECK-INLINE-NEXT: store volatile i8 0, ptr [[TMP79]], align 1157; CHECK-INLINE-NEXT: invoke void @MayThrowFunc()158; CHECK-INLINE-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[EHCLEANUP:%.*]]159; CHECK-INLINE: invoke.cont:160; CHECK-INLINE-NEXT: call void @DeInit(ptr [[TMP14]])161; CHECK-INLINE-NEXT: [[TMP91:%.*]] = ptrtoint ptr [[TMP0]] to i64162; CHECK-INLINE-NEXT: [[TMP92:%.*]] = load i64, ptr [[TMP0]], align 8163; CHECK-INLINE-NEXT: call void @__asan_allocas_unpoison(i64 [[TMP92]], i64 [[TMP91]])164; CHECK-INLINE-NEXT: store i64 1172321806, ptr [[TMP23]], align 8165; CHECK-INLINE-NEXT: [[TMP93:%.*]] = icmp ne i64 [[TMP7]], 0166; CHECK-INLINE-NEXT: br i1 [[TMP93]], label [[TMP94:%.*]], label [[TMP95:%.*]]167; CHECK-INLINE: 88:168; CHECK-INLINE-NEXT: call void @__asan_stack_free_8(i64 [[TMP7]], i64 8544)169; CHECK-INLINE-NEXT: br label [[TMP97:%.*]]170; CHECK-INLINE: 89:171; CHECK-INLINE-NEXT: call void @__asan_set_shadow_00(i64 [[TMP29]], i64 4)172; CHECK-INLINE-NEXT: [[TMP96:%.*]] = add i64 [[TMP29]], 1028173; CHECK-INLINE-NEXT: call void @__asan_set_shadow_00(i64 [[TMP96]], i64 40)174; CHECK-INLINE-NEXT: br label [[TMP97]]175; CHECK-INLINE: 91:176; CHECK-INLINE-NEXT: ret void177; CHECK-INLINE: ehcleanup:178; CHECK-INLINE-NEXT: [[TMP98:%.*]] = cleanuppad within none []179; CHECK-INLINE-NEXT: call void @__asan_unpoison_stack_memory(i64 [[TMP54]], i64 4) [ "funclet"(token [[TMP98]]) ]180; CHECK-INLINE-NEXT: [[TMP99:%.*]] = lshr i64 [[TMP54]], 3181; CHECK-INLINE-NEXT: [[TMP100:%.*]] = add i64 [[TMP99]], [[TMP1]]182; CHECK-INLINE-NEXT: [[TMP101:%.*]] = inttoptr i64 [[TMP100]] to ptr183; CHECK-INLINE-NEXT: [[TMP102:%.*]] = load i8, ptr [[TMP101]], align 1184; CHECK-INLINE-NEXT: [[TMP103:%.*]] = icmp ne i8 [[TMP102]], 0185; CHECK-INLINE-NEXT: br i1 [[TMP103]], label [[TMP104:%.*]], label [[TMP109:%.*]], !prof [[PROF1]]186; CHECK-INLINE: 98:187; CHECK-INLINE-NEXT: [[TMP105:%.*]] = and i64 [[TMP54]], 7188; CHECK-INLINE-NEXT: [[TMP106:%.*]] = trunc i64 [[TMP105]] to i8189; CHECK-INLINE-NEXT: [[TMP107:%.*]] = icmp sge i8 [[TMP106]], [[TMP102]]190; CHECK-INLINE-NEXT: br i1 [[TMP107]], label [[TMP108:%.*]], label [[TMP109]]191; CHECK-INLINE: 102:192; CHECK-INLINE-NEXT: call void @__asan_report_store1(i64 [[TMP54]]) #[[ATTR7]] [ "funclet"(token [[TMP98]]) ]193; CHECK-INLINE-NEXT: unreachable194; CHECK-INLINE: 103:195; CHECK-INLINE-NEXT: store volatile i8 0, ptr [[TMP56]], align 1196; CHECK-INLINE-NEXT: call void @__asan_poison_stack_memory(i64 [[TMP54]], i64 4) [ "funclet"(token [[TMP98]]) ]197; CHECK-INLINE-NEXT: call void @DeInit(ptr [[TMP14]]) [ "funclet"(token [[TMP98]]) ]198; CHECK-INLINE-NEXT: [[TMP110:%.*]] = call ptr @__asan_memset(ptr [[TMP16]], i32 0, i64 4) [ "funclet"(token [[TMP98]]) ]199; CHECK-INLINE-NEXT: [[TMP111:%.*]] = call ptr @__asan_memcpy(ptr [[TMP18]], ptr [[TMP16]], i64 4) [ "funclet"(token [[TMP98]]) ]200; CHECK-INLINE-NEXT: [[TMP112:%.*]] = call ptr @__asan_memmove(ptr [[TMP20]], ptr [[TMP16]], i64 4) [ "funclet"(token [[TMP98]]) ]201; CHECK-INLINE-NEXT: [[TMP15:%.*]] = ptrtoint ptr [[TMP16]] to i64202; CHECK-INLINE-NEXT: [[TMP17:%.*]] = ptrtoint ptr [[TMP18]] to i64203; CHECK-INLINE-NEXT: call void @__sanitizer_ptr_cmp(i64 [[TMP15]], i64 [[TMP17]]) [ "funclet"(token [[TMP98]]) ]204; CHECK-INLINE-NEXT: [[ADDR1:%.*]] = ptrtoint ptr [[TMP16]] to i64205; CHECK-INLINE-NEXT: [[ADDR2:%.*]] = ptrtoint ptr [[TMP18]] to i64206; CHECK-INLINE-NEXT: call void @__sanitizer_ptr_sub(i64 [[ADDR1]], i64 [[ADDR2]]) [ "funclet"(token [[TMP98]]) ]207; CHECK-INLINE-NEXT: [[TMP113:%.*]] = ptrtoint ptr [[PTRPARAM]] to i64208; CHECK-INLINE-NEXT: [[TMP114:%.*]] = add i64 [[TMP113]], 7209; CHECK-INLINE-NEXT: [[TMP115:%.*]] = inttoptr i64 [[TMP114]] to ptr210; CHECK-INLINE-NEXT: [[TMP116:%.*]] = ptrtoint ptr [[PTRPARAM]] to i64211; CHECK-INLINE-NEXT: [[TMP117:%.*]] = lshr i64 [[TMP116]], 3212; CHECK-INLINE-NEXT: [[TMP118:%.*]] = add i64 [[TMP117]], [[TMP1]]213; CHECK-INLINE-NEXT: [[TMP119:%.*]] = inttoptr i64 [[TMP118]] to ptr214; CHECK-INLINE-NEXT: [[TMP120:%.*]] = load i8, ptr [[TMP119]], align 1215; CHECK-INLINE-NEXT: [[TMP121:%.*]] = icmp ne i8 [[TMP120]], 0216; CHECK-INLINE-NEXT: br i1 [[TMP121]], label [[TMP122:%.*]], label [[TMP127:%.*]], !prof [[PROF1]]217; CHECK-INLINE: 118:218; CHECK-INLINE-NEXT: [[TMP123:%.*]] = and i64 [[TMP116]], 7219; CHECK-INLINE-NEXT: [[TMP124:%.*]] = trunc i64 [[TMP123]] to i8220; CHECK-INLINE-NEXT: [[TMP125:%.*]] = icmp sge i8 [[TMP124]], [[TMP120]]221; CHECK-INLINE-NEXT: br i1 [[TMP125]], label [[TMP126:%.*]], label [[TMP127]]222; CHECK-INLINE: 122:223; CHECK-INLINE-NEXT: call void @__asan_report_store_n(i64 [[TMP116]], i64 8) #[[ATTR7]] [ "funclet"(token [[TMP98]]) ]224; CHECK-INLINE-NEXT: unreachable225; CHECK-INLINE: 123:226; CHECK-INLINE-NEXT: [[TMP128:%.*]] = lshr i64 [[TMP114]], 3227; CHECK-INLINE-NEXT: [[TMP129:%.*]] = add i64 [[TMP128]], [[TMP1]]228; CHECK-INLINE-NEXT: [[TMP130:%.*]] = inttoptr i64 [[TMP129]] to ptr229; CHECK-INLINE-NEXT: [[TMP131:%.*]] = load i8, ptr [[TMP130]], align 1230; CHECK-INLINE-NEXT: [[TMP132:%.*]] = icmp ne i8 [[TMP131]], 0231; CHECK-INLINE-NEXT: br i1 [[TMP132]], label [[TMP133:%.*]], label [[EHEXIT:%.*]], !prof [[PROF1]]232; CHECK-INLINE: 129:233; CHECK-INLINE-NEXT: [[TMP134:%.*]] = and i64 [[TMP114]], 7234; CHECK-INLINE-NEXT: [[TMP135:%.*]] = trunc i64 [[TMP134]] to i8235; CHECK-INLINE-NEXT: [[TMP136:%.*]] = icmp sge i8 [[TMP135]], [[TMP131]]236; CHECK-INLINE-NEXT: br i1 [[TMP136]], label [[TMP137:%.*]], label [[EHEXIT]]237; CHECK-INLINE: 133:238; CHECK-INLINE-NEXT: call void @__asan_report_store_n(i64 [[TMP114]], i64 8) #[[ATTR7]] [ "funclet"(token [[TMP98]]) ]239; CHECK-INLINE-NEXT: unreachable240; CHECK-INLINE: ehexit:241; CHECK-INLINE-NEXT: store i64 0, ptr [[PTRPARAM]], align 1242; CHECK-INLINE-NEXT: [[TMP138:%.*]] = call i64 @llvm.get.dynamic.area.offset.i64()243; CHECK-INLINE-NEXT: [[TMP139:%.*]] = ptrtoint ptr [[TMP0]] to i64244; CHECK-INLINE-NEXT: [[TMP140:%.*]] = add i64 [[TMP139]], [[TMP138]]245; CHECK-INLINE-NEXT: [[TMP141:%.*]] = load i64, ptr [[TMP0]], align 8246; CHECK-INLINE-NEXT: call void @__asan_allocas_unpoison(i64 [[TMP141]], i64 [[TMP140]]) [ "funclet"(token [[TMP98]]) ]247; CHECK-INLINE-NEXT: store i64 1172321806, ptr [[TMP23]], align 8248; CHECK-INLINE-NEXT: [[TMP142:%.*]] = icmp ne i64 [[TMP7]], 0249; CHECK-INLINE-NEXT: br i1 [[TMP142]], label [[TMP143:%.*]], label [[TMP144:%.*]]250; CHECK-INLINE: 139:251; CHECK-INLINE-NEXT: call void @__asan_stack_free_8(i64 [[TMP7]], i64 8544) [ "funclet"(token [[TMP98]]) ]252; CHECK-INLINE-NEXT: br label [[TMP146:%.*]]253; CHECK-INLINE: 140:254; CHECK-INLINE-NEXT: call void @__asan_set_shadow_00(i64 [[TMP29]], i64 4) [ "funclet"(token [[TMP98]]) ]255; CHECK-INLINE-NEXT: [[TMP145:%.*]] = add i64 [[TMP29]], 1028256; CHECK-INLINE-NEXT: call void @__asan_set_shadow_00(i64 [[TMP145]], i64 40) [ "funclet"(token [[TMP98]]) ]257; CHECK-INLINE-NEXT: br label [[TMP146]]258; CHECK-INLINE: 142:259; CHECK-INLINE-NEXT: cleanupret from [[TMP98]] unwind to caller260;261; CHECK-OUTLINE-LABEL: define void @FuncletPersonality(262; CHECK-OUTLINE-SAME: ptr [[PTRPARAM:%.*]]) #[[ATTR2:[0-9]+]] personality ptr @__CxxFrameHandler3 {263; CHECK-OUTLINE-NEXT: entry:264; CHECK-OUTLINE-NEXT: [[TMP0:%.*]] = alloca i64, align 32265; CHECK-OUTLINE-NEXT: store i64 0, ptr [[TMP0]], align 8266; CHECK-OUTLINE-NEXT: [[TMP1:%.*]] = load i64, ptr @__asan_shadow_memory_dynamic_address, align 8267; CHECK-OUTLINE-NEXT: [[ASAN_LOCAL_STACK_BASE:%.*]] = alloca i64, align 8268; CHECK-OUTLINE-NEXT: [[TMP2:%.*]] = load i32, ptr @__asan_option_detect_stack_use_after_return, align 4269; CHECK-OUTLINE-NEXT: [[TMP3:%.*]] = icmp ne i32 [[TMP2]], 0270; CHECK-OUTLINE-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP6:%.*]]271; CHECK-OUTLINE: 4:272; CHECK-OUTLINE-NEXT: [[TMP5:%.*]] = call i64 @__asan_stack_malloc_8(i64 8608)273; CHECK-OUTLINE-NEXT: br label [[TMP6]]274; CHECK-OUTLINE: 6:275; CHECK-OUTLINE-NEXT: [[TMP7:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[TMP5]], [[TMP4]] ]276; CHECK-OUTLINE-NEXT: [[TMP10:%.*]] = inttoptr i64 [[TMP7]] to ptr277; CHECK-OUTLINE-NEXT: [[TMP8:%.*]] = icmp eq i64 [[TMP7]], 0278; CHECK-OUTLINE-NEXT: br i1 [[TMP8]], label [[TMP9:%.*]], label [[TMP11:%.*]]279; CHECK-OUTLINE: 10:280; CHECK-OUTLINE-NEXT: [[MYALLOCA:%.*]] = alloca i8, i64 8608, align 32281; CHECK-OUTLINE-NEXT: br label [[TMP11]]282; CHECK-OUTLINE: 11:283; CHECK-OUTLINE-NEXT: [[TMP27:%.*]] = phi ptr [ [[TMP10]], [[TMP6]] ], [ [[MYALLOCA]], [[TMP9]] ]284; CHECK-OUTLINE-NEXT: store ptr [[TMP27]], ptr [[ASAN_LOCAL_STACK_BASE]], align 8285; CHECK-OUTLINE-NEXT: [[TMP14:%.*]] = getelementptr i8, ptr [[TMP27]], i64 32286; CHECK-OUTLINE-NEXT: [[TMP16:%.*]] = getelementptr i8, ptr [[TMP27]], i64 8480287; CHECK-OUTLINE-NEXT: [[TMP18:%.*]] = getelementptr i8, ptr [[TMP27]], i64 8496288; CHECK-OUTLINE-NEXT: [[TMP20:%.*]] = getelementptr i8, ptr [[TMP27]], i64 8512289; CHECK-OUTLINE-NEXT: [[TMP22:%.*]] = getelementptr i8, ptr [[TMP27]], i64 8528290; CHECK-OUTLINE-NEXT: [[TMP24:%.*]] = getelementptr i8, ptr [[TMP27]], i64 8544291; CHECK-OUTLINE-NEXT: [[TMP26:%.*]] = getelementptr i8, ptr [[TMP27]], i64 8560292; CHECK-OUTLINE-NEXT: store i64 1102416563, ptr [[TMP27]], align 8293; CHECK-OUTLINE-NEXT: [[TMP29:%.*]] = getelementptr i8, ptr [[TMP27]], i64 8294; CHECK-OUTLINE-NEXT: store i64 ptrtoint (ptr @___asan_gen_stack to i64), ptr [[TMP29]], align 8295; CHECK-OUTLINE-NEXT: [[TMP31:%.*]] = getelementptr i8, ptr [[TMP27]], i64 16296; CHECK-OUTLINE-NEXT: store i64 ptrtoint (ptr @FuncletPersonality to i64), ptr [[TMP31]], align 8297; CHECK-OUTLINE-NEXT: [[TMP12:%.*]] = ptrtoint ptr [[TMP27]] to i64298; CHECK-OUTLINE-NEXT: [[TMP32:%.*]] = lshr i64 [[TMP12]], 3299; CHECK-OUTLINE-NEXT: [[TMP33:%.*]] = add i64 [[TMP32]], [[TMP1]]300; CHECK-OUTLINE-NEXT: call void @__asan_set_shadow_f1(i64 [[TMP33]], i64 4)301; CHECK-OUTLINE-NEXT: [[TMP34:%.*]] = add i64 [[TMP33]], 1028302; CHECK-OUTLINE-NEXT: call void @__asan_set_shadow_f2(i64 [[TMP34]], i64 32)303; CHECK-OUTLINE-NEXT: [[TMP35:%.*]] = add i64 [[TMP33]], 1060304; CHECK-OUTLINE-NEXT: call void @__asan_set_shadow_04(i64 [[TMP35]], i64 1)305; CHECK-OUTLINE-NEXT: [[TMP36:%.*]] = add i64 [[TMP33]], 1061306; CHECK-OUTLINE-NEXT: call void @__asan_set_shadow_f2(i64 [[TMP36]], i64 1)307; CHECK-OUTLINE-NEXT: [[TMP37:%.*]] = add i64 [[TMP33]], 1062308; CHECK-OUTLINE-NEXT: call void @__asan_set_shadow_04(i64 [[TMP37]], i64 1)309; CHECK-OUTLINE-NEXT: [[TMP38:%.*]] = add i64 [[TMP33]], 1063310; CHECK-OUTLINE-NEXT: call void @__asan_set_shadow_f2(i64 [[TMP38]], i64 1)311; CHECK-OUTLINE-NEXT: [[TMP39:%.*]] = add i64 [[TMP33]], 1064312; CHECK-OUTLINE-NEXT: call void @__asan_set_shadow_04(i64 [[TMP39]], i64 1)313; CHECK-OUTLINE-NEXT: [[TMP40:%.*]] = add i64 [[TMP33]], 1065314; CHECK-OUTLINE-NEXT: call void @__asan_set_shadow_f2(i64 [[TMP40]], i64 1)315; CHECK-OUTLINE-NEXT: [[TMP41:%.*]] = add i64 [[TMP33]], 1066316; CHECK-OUTLINE-NEXT: call void @__asan_set_shadow_f8(i64 [[TMP41]], i64 1)317; CHECK-OUTLINE-NEXT: [[TMP42:%.*]] = add i64 [[TMP33]], 1067318; CHECK-OUTLINE-NEXT: call void @__asan_set_shadow_f2(i64 [[TMP42]], i64 1)319; CHECK-OUTLINE-NEXT: [[TMP43:%.*]] = add i64 [[TMP33]], 1068320; CHECK-OUTLINE-NEXT: call void @__asan_set_shadow_f8(i64 [[TMP43]], i64 1)321; CHECK-OUTLINE-NEXT: [[TMP44:%.*]] = add i64 [[TMP33]], 1069322; CHECK-OUTLINE-NEXT: call void @__asan_set_shadow_f2(i64 [[TMP44]], i64 1)323; CHECK-OUTLINE-NEXT: [[TMP45:%.*]] = add i64 [[TMP33]], 1071324; CHECK-OUTLINE-NEXT: call void @__asan_set_shadow_f3(i64 [[TMP45]], i64 5)325; CHECK-OUTLINE-NEXT: [[TMP46:%.*]] = add i64 [[TMP33]], 1066326; CHECK-OUTLINE-NEXT: call void @__asan_set_shadow_04(i64 [[TMP46]], i64 1)327; CHECK-OUTLINE-NEXT: [[TMP21:%.*]] = ptrtoint ptr [[TMP22]] to i64328; CHECK-OUTLINE-NEXT: call void @__asan_store1(i64 [[TMP21]])329; CHECK-OUTLINE-NEXT: store volatile i8 0, ptr [[TMP22]], align 1330; CHECK-OUTLINE-NEXT: [[TMP47:%.*]] = add i64 [[TMP33]], 1066331; CHECK-OUTLINE-NEXT: call void @__asan_set_shadow_f8(i64 [[TMP47]], i64 1)332; CHECK-OUTLINE-NEXT: [[TMP25:%.*]] = ptrtoint ptr [[TMP26]] to i64333; CHECK-OUTLINE-NEXT: call void @__asan_store8(i64 [[TMP25]])334; CHECK-OUTLINE-NEXT: store volatile i64 0, ptr [[TMP26]], align 8335; CHECK-OUTLINE-NEXT: [[TMPCOPYI64:%.*]] = load i64, ptr [[TMP26]], align 8336; CHECK-OUTLINE-NEXT: [[TMP48:%.*]] = and i64 [[TMPCOPYI64]], 31337; CHECK-OUTLINE-NEXT: [[TMP49:%.*]] = sub i64 32, [[TMP48]]338; CHECK-OUTLINE-NEXT: [[TMP50:%.*]] = icmp ne i64 [[TMP49]], 32339; CHECK-OUTLINE-NEXT: [[TMP51:%.*]] = select i1 [[TMP50]], i64 [[TMP49]], i64 0340; CHECK-OUTLINE-NEXT: [[TMP52:%.*]] = add i64 64, [[TMP51]]341; CHECK-OUTLINE-NEXT: [[TMP53:%.*]] = add i64 [[TMPCOPYI64]], [[TMP52]]342; CHECK-OUTLINE-NEXT: [[TMP54:%.*]] = alloca i8, i64 [[TMP53]], align 32343; CHECK-OUTLINE-NEXT: [[TMP55:%.*]] = ptrtoint ptr [[TMP54]] to i64344; CHECK-OUTLINE-NEXT: [[TMP56:%.*]] = add i64 [[TMP55]], 32345; CHECK-OUTLINE-NEXT: call void @__asan_alloca_poison(i64 [[TMP56]], i64 [[TMPCOPYI64]])346; CHECK-OUTLINE-NEXT: [[TMP57:%.*]] = ptrtoint ptr [[TMP54]] to i64347; CHECK-OUTLINE-NEXT: store i64 [[TMP57]], ptr [[TMP0]], align 8348; CHECK-OUTLINE-NEXT: [[TMP58:%.*]] = inttoptr i64 [[TMP56]] to ptr349; CHECK-OUTLINE-NEXT: call void @__asan_store1(i64 [[TMP56]])350; CHECK-OUTLINE-NEXT: store volatile i8 0, ptr [[TMP58]], align 1351; CHECK-OUTLINE-NEXT: invoke void @MayThrowFunc()352; CHECK-OUTLINE-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[EHCLEANUP:%.*]]353; CHECK-OUTLINE: invoke.cont:354; CHECK-OUTLINE-NEXT: call void @DeInit(ptr [[TMP14]])355; CHECK-OUTLINE-NEXT: [[TMP59:%.*]] = ptrtoint ptr [[TMP0]] to i64356; CHECK-OUTLINE-NEXT: [[TMP60:%.*]] = load i64, ptr [[TMP0]], align 8357; CHECK-OUTLINE-NEXT: call void @__asan_allocas_unpoison(i64 [[TMP60]], i64 [[TMP59]])358; CHECK-OUTLINE-NEXT: store i64 1172321806, ptr [[TMP27]], align 8359; CHECK-OUTLINE-NEXT: [[TMP61:%.*]] = icmp ne i64 [[TMP7]], 0360; CHECK-OUTLINE-NEXT: br i1 [[TMP61]], label [[TMP62:%.*]], label [[TMP63:%.*]]361; CHECK-OUTLINE: 55:362; CHECK-OUTLINE-NEXT: call void @__asan_stack_free_8(i64 [[TMP7]], i64 8608)363; CHECK-OUTLINE-NEXT: br label [[TMP66:%.*]]364; CHECK-OUTLINE: 56:365; CHECK-OUTLINE-NEXT: call void @__asan_set_shadow_00(i64 [[TMP33]], i64 4)366; CHECK-OUTLINE-NEXT: [[TMP64:%.*]] = add i64 [[TMP33]], 1028367; CHECK-OUTLINE-NEXT: call void @__asan_set_shadow_00(i64 [[TMP64]], i64 42)368; CHECK-OUTLINE-NEXT: [[TMP65:%.*]] = add i64 [[TMP33]], 1071369; CHECK-OUTLINE-NEXT: call void @__asan_set_shadow_00(i64 [[TMP65]], i64 5)370; CHECK-OUTLINE-NEXT: br label [[TMP66]]371; CHECK-OUTLINE: 59:372; CHECK-OUTLINE-NEXT: ret void373; CHECK-OUTLINE: ehcleanup:374; CHECK-OUTLINE-NEXT: [[TMP67:%.*]] = cleanuppad within none []375; CHECK-OUTLINE-NEXT: [[TMP68:%.*]] = add i64 [[TMP33]], 1068376; CHECK-OUTLINE-NEXT: call void @__asan_set_shadow_04(i64 [[TMP68]], i64 1) [ "funclet"(token [[TMP67]]) ]377; CHECK-OUTLINE-NEXT: [[TMP23:%.*]] = ptrtoint ptr [[TMP24]] to i64378; CHECK-OUTLINE-NEXT: call void @__asan_store1(i64 [[TMP23]]) [ "funclet"(token [[TMP67]]) ]379; CHECK-OUTLINE-NEXT: store volatile i8 0, ptr [[TMP24]], align 1380; CHECK-OUTLINE-NEXT: [[TMP69:%.*]] = add i64 [[TMP33]], 1068381; CHECK-OUTLINE-NEXT: call void @__asan_set_shadow_f8(i64 [[TMP69]], i64 1) [ "funclet"(token [[TMP67]]) ]382; CHECK-OUTLINE-NEXT: call void @DeInit(ptr [[TMP14]]) [ "funclet"(token [[TMP67]]) ]383; CHECK-OUTLINE-NEXT: [[TMP70:%.*]] = call ptr @__asan_memset(ptr [[TMP16]], i32 0, i64 4) [ "funclet"(token [[TMP67]]) ]384; CHECK-OUTLINE-NEXT: [[TMP71:%.*]] = call ptr @__asan_memcpy(ptr [[TMP18]], ptr [[TMP16]], i64 4) [ "funclet"(token [[TMP67]]) ]385; CHECK-OUTLINE-NEXT: [[TMP72:%.*]] = call ptr @__asan_memmove(ptr [[TMP20]], ptr [[TMP16]], i64 4) [ "funclet"(token [[TMP67]]) ]386; CHECK-OUTLINE-NEXT: [[TMP15:%.*]] = ptrtoint ptr [[TMP16]] to i64387; CHECK-OUTLINE-NEXT: [[TMP17:%.*]] = ptrtoint ptr [[TMP18]] to i64388; CHECK-OUTLINE-NEXT: call void @__sanitizer_ptr_cmp(i64 [[TMP15]], i64 [[TMP17]]) [ "funclet"(token [[TMP67]]) ]389; CHECK-OUTLINE-NEXT: [[ADDR1:%.*]] = ptrtoint ptr [[TMP16]] to i64390; CHECK-OUTLINE-NEXT: [[ADDR2:%.*]] = ptrtoint ptr [[TMP18]] to i64391; CHECK-OUTLINE-NEXT: call void @__sanitizer_ptr_sub(i64 [[ADDR1]], i64 [[ADDR2]]) [ "funclet"(token [[TMP67]]) ]392; CHECK-OUTLINE-NEXT: [[TMP73:%.*]] = ptrtoint ptr [[PTRPARAM]] to i64393; CHECK-OUTLINE-NEXT: call void @__asan_storeN(i64 [[TMP73]], i64 8) [ "funclet"(token [[TMP67]]) ]394; CHECK-OUTLINE-NEXT: store i64 0, ptr [[PTRPARAM]], align 1395; CHECK-OUTLINE-NEXT: [[TMP74:%.*]] = call i64 @llvm.get.dynamic.area.offset.i64()396; CHECK-OUTLINE-NEXT: [[TMP75:%.*]] = ptrtoint ptr [[TMP0]] to i64397; CHECK-OUTLINE-NEXT: [[TMP76:%.*]] = add i64 [[TMP75]], [[TMP74]]398; CHECK-OUTLINE-NEXT: [[TMP77:%.*]] = load i64, ptr [[TMP0]], align 8399; CHECK-OUTLINE-NEXT: call void @__asan_allocas_unpoison(i64 [[TMP77]], i64 [[TMP76]]) [ "funclet"(token [[TMP67]]) ]400; CHECK-OUTLINE-NEXT: store i64 1172321806, ptr [[TMP27]], align 8401; CHECK-OUTLINE-NEXT: [[TMP78:%.*]] = icmp ne i64 [[TMP7]], 0402; CHECK-OUTLINE-NEXT: br i1 [[TMP78]], label [[TMP79:%.*]], label [[TMP80:%.*]]403; CHECK-OUTLINE: 75:404; CHECK-OUTLINE-NEXT: call void @__asan_stack_free_8(i64 [[TMP7]], i64 8608) [ "funclet"(token [[TMP67]]) ]405; CHECK-OUTLINE-NEXT: br label [[TMP83:%.*]]406; CHECK-OUTLINE: 76:407; CHECK-OUTLINE-NEXT: call void @__asan_set_shadow_00(i64 [[TMP33]], i64 4) [ "funclet"(token [[TMP67]]) ]408; CHECK-OUTLINE-NEXT: [[TMP81:%.*]] = add i64 [[TMP33]], 1028409; CHECK-OUTLINE-NEXT: call void @__asan_set_shadow_00(i64 [[TMP81]], i64 42) [ "funclet"(token [[TMP67]]) ]410; CHECK-OUTLINE-NEXT: [[TMP82:%.*]] = add i64 [[TMP33]], 1071411; CHECK-OUTLINE-NEXT: call void @__asan_set_shadow_00(i64 [[TMP82]], i64 5) [ "funclet"(token [[TMP67]]) ]412; CHECK-OUTLINE-NEXT: br label [[TMP83]]413; CHECK-OUTLINE: 79:414; CHECK-OUTLINE-NEXT: cleanupret from [[TMP67]] unwind to caller415;416 417 418entry:419 ; Large enough local alloca to have asan generate a __asan_stack_free_#() call420 %largeObj = alloca [2048 x i32], align 16421 %tmpInt1 = alloca i32, align 4422 %tmpInt2 = alloca i32, align 4423 %tmpInt3 = alloca i32, align 4424 425 ; Creating %lifetimeInt and %lifetimeArr, and managing their lifetimes426 ; to make asan generate stack poisoning calls427 %lifetimeInt = alloca i32, align 4428 call void @llvm.lifetime.start.p0(i64 4, ptr %lifetimeInt)429 store volatile i8 0, ptr %lifetimeInt430 call void @llvm.lifetime.end.p0(i64 4, ptr %lifetimeInt)431 %lifetimeArr = alloca i32, align 4432 433 ; Dynamic alloca to generate a @__asan_allocas_unpoison call in ehcleanup434 %tmpVolatilei64 = alloca i64, align 8435 store volatile i64 0, ptr %tmpVolatilei64, align 8436 %tmpCopyi64 = load i64, ptr %tmpVolatilei64, align 8437 %tmpVolatilei8 = alloca i8, i64 %tmpCopyi64, align 32438 store volatile i8 0, ptr %tmpVolatilei8439 440 invoke void @MayThrowFunc()441 to label %invoke.cont unwind label %ehcleanup442invoke.cont: ; preds = %entry443 call void @DeInit(ptr %largeObj)444 ret void445 446ehcleanup: ; preds = %entry447 %0 = cleanuppad within none []448 449 ; Make asan add a call to __asan_unpoison_stack_memory450 call void @llvm.lifetime.start.p0(i64 4, ptr %lifetimeArr)451 ; Make asan add a call to __asan_report_store1452 store volatile i8 0, ptr %lifetimeArr453 ; Make asan add a call to __asan_poison_stack_memory454 call void @llvm.lifetime.end.p0(i64 4, ptr %lifetimeArr)455 456 call void @DeInit(ptr %largeObj) [ "funclet"(token %0) ]457 call void @llvm.memset.p0.i64(ptr align 4 %tmpInt1, i8 0, i64 4, i1 false)458 call void @llvm.memcpy.p0.p0.i64(ptr align 4 %tmpInt2, ptr align 4 %tmpInt1, i64 4, i1 false)459 call void @llvm.memmove.p0.p0.i64(ptr align 4 %tmpInt3, ptr align 4 %tmpInt1, i64 4, i1 false)460 %cmpAddr = icmp ule ptr %tmpInt1, %tmpInt2461 %addr1 = ptrtoint ptr %tmpInt1 to i64462 %addr2 = ptrtoint ptr %tmpInt2 to i64463 %subAddr = sub i64 %addr1, %addr2464 465 store i64 0, ptr %ptrParam, align 1466 467 %cmp = icmp ne i64 %subAddr, 0468 br i1 %cmp, label %ehexit, label %noreturncall469 470noreturncall:471 call void @NoReturn(ptr null, ptr null) noreturn [ "funclet"(token %0) ]472 unreachable473 474ehexit:475 cleanupret from %0 unwind to caller476 477; Ensure unreachable basic block doesn't make the compiler assert, as it's a special case for coloring computation.478nopredecessor:479 call void @llvm.memset.p0.i64(ptr align 4 %tmpInt1, i8 0, i64 4, i1 false)480 unreachable481}482 483; Non-Windows personality, ensure no funclet gets attached to asan runtime call.484define void @OtherPersonality(ptr %ptrParam) sanitize_address personality ptr @dummyPersonality {485; CHECK-LABEL: define void @OtherPersonality(486; CHECK-SAME: ptr [[PTRPARAM:%.*]]) #[[ATTR2:[0-9]+]] personality ptr @dummyPersonality {487; CHECK-NEXT: entry:488; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr @__asan_shadow_memory_dynamic_address, align 8489; CHECK-NEXT: [[ASAN_LOCAL_STACK_BASE:%.*]] = alloca i64, align 8490; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr @__asan_option_detect_stack_use_after_return, align 4491; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0492; CHECK-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]]493; CHECK: 3:494; CHECK-NEXT: [[TMP4:%.*]] = call i64 @__asan_stack_malloc_0(i64 64)495; CHECK-NEXT: br label [[TMP5]]496; CHECK: 5:497; CHECK-NEXT: [[TMP6:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[TMP4]], [[TMP3]] ]498; CHECK-NEXT: [[TMP9:%.*]] = inttoptr i64 [[TMP6]] to ptr499; CHECK-NEXT: [[TMP7:%.*]] = icmp eq i64 [[TMP6]], 0500; CHECK-NEXT: br i1 [[TMP7]], label [[TMP8:%.*]], label [[TMP10:%.*]]501; CHECK: 9:502; CHECK-NEXT: [[MYALLOCA:%.*]] = alloca i8, i64 64, align 32503; CHECK-NEXT: br label [[TMP10]]504; CHECK: 10:505; CHECK-NEXT: [[TMP14:%.*]] = phi ptr [ [[TMP9]], [[TMP5]] ], [ [[MYALLOCA]], [[TMP8]] ]506; CHECK-NEXT: store ptr [[TMP14]], ptr [[ASAN_LOCAL_STACK_BASE]], align 8507; CHECK-NEXT: [[TMP13:%.*]] = getelementptr i8, ptr [[TMP14]], i64 32508; CHECK-NEXT: store i64 1102416563, ptr [[TMP14]], align 8509; CHECK-NEXT: [[TMP16:%.*]] = getelementptr i8, ptr [[TMP14]], i64 8510; CHECK-NEXT: store i64 ptrtoint (ptr @___asan_gen_stack.1 to i64), ptr [[TMP16]], align 8511; CHECK-NEXT: [[TMP18:%.*]] = getelementptr i8, ptr [[TMP14]], i64 16512; CHECK-NEXT: store i64 ptrtoint (ptr @OtherPersonality to i64), ptr [[TMP18]], align 8513; CHECK-NEXT: [[TMP11:%.*]] = ptrtoint ptr [[TMP14]] to i64514; CHECK-NEXT: [[TMP19:%.*]] = lshr i64 [[TMP11]], 3515; CHECK-NEXT: [[TMP20:%.*]] = add i64 [[TMP19]], [[TMP0]]516; CHECK-NEXT: [[TMP21:%.*]] = add i64 [[TMP20]], 0517; CHECK-NEXT: call void @__asan_set_shadow_f1(i64 [[TMP21]], i64 4)518; CHECK-NEXT: [[TMP22:%.*]] = add i64 [[TMP20]], 4519; CHECK-NEXT: call void @__asan_set_shadow_04(i64 [[TMP22]], i64 1)520; CHECK-NEXT: [[TMP23:%.*]] = add i64 [[TMP20]], 5521; CHECK-NEXT: call void @__asan_set_shadow_f3(i64 [[TMP23]], i64 3)522; CHECK-NEXT: invoke void @MayThrowFunc()523; CHECK-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[EHCLEANUP:%.*]]524; CHECK: invoke.cont:525; CHECK-NEXT: store i64 1172321806, ptr [[TMP14]], align 8526; CHECK-NEXT: [[TMP24:%.*]] = icmp ne i64 [[TMP6]], 0527; CHECK-NEXT: br i1 [[TMP24]], label [[TMP25:%.*]], label [[TMP26:%.*]]528; CHECK: 22:529; CHECK-NEXT: call void @__asan_stack_free_0(i64 [[TMP6]], i64 64)530; CHECK-NEXT: br label [[TMP28:%.*]]531; CHECK: 23:532; CHECK-NEXT: [[TMP27:%.*]] = add i64 [[TMP20]], 0533; CHECK-NEXT: call void @__asan_set_shadow_00(i64 [[TMP27]], i64 8)534; CHECK-NEXT: br label [[TMP28]]535; CHECK: 25:536; CHECK-NEXT: ret void537; CHECK: ehcleanup:538; CHECK-NEXT: [[TMP29:%.*]] = cleanuppad within none []539; CHECK-NEXT: [[TMP30:%.*]] = call ptr @__asan_memset(ptr [[TMP13]], i32 0, i64 4)540; CHECK-NEXT: store i64 1172321806, ptr [[TMP14]], align 8541; CHECK-NEXT: [[TMP31:%.*]] = icmp ne i64 [[TMP6]], 0542; CHECK-NEXT: br i1 [[TMP31]], label [[TMP32:%.*]], label [[TMP33:%.*]]543; CHECK: 29:544; CHECK-NEXT: call void @__asan_stack_free_0(i64 [[TMP6]], i64 64)545; CHECK-NEXT: br label [[TMP35:%.*]]546; CHECK: 30:547; CHECK-NEXT: [[TMP34:%.*]] = add i64 [[TMP20]], 0548; CHECK-NEXT: call void @__asan_set_shadow_00(i64 [[TMP34]], i64 8)549; CHECK-NEXT: br label [[TMP35]]550; CHECK: 32:551; CHECK-NEXT: cleanupret from [[TMP29]] unwind to caller552;553entry:554 %tmpInt = alloca i32, align 4555 invoke void @MayThrowFunc()556 to label %invoke.cont unwind label %ehcleanup557invoke.cont: ; preds = %entry558 ret void559 560ehcleanup: ; preds = %entry561 %0 = cleanuppad within none []562 call void @llvm.memset.p0.i64(ptr align 4 %tmpInt, i8 0, i64 4, i1 false)563 cleanupret from %0 unwind to caller564}565;.566; CHECK-INLINE: [[PROF1]] = !{!"branch_weights", i32 1, i32 1048575}567;.568