1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc < %s -mtriple=i686-windows-gnu | FileCheck %s --check-prefix=CHECK-MINGW-X86 3 4%struct.as = type { i32* } 5 6@_ZZ2amiE2au = internal unnamed_addr global %struct.as zeroinitializer, align 4 7@_ZGVZ2amiE2au = internal global i64 0, align 8 8@_ZTIi = external constant i8* 9 10define void @_Z2ami(i32) #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { 11; CHECK-MINGW-X86-LABEL: _Z2ami: 12; CHECK-MINGW-X86: # %bb.0: # %entry 13; CHECK-MINGW-X86-NEXT: pushl %edi 14; CHECK-MINGW-X86-NEXT: .cfi_def_cfa_offset 8 15; CHECK-MINGW-X86-NEXT: pushl %esi 16; CHECK-MINGW-X86-NEXT: .cfi_def_cfa_offset 12 17; CHECK-MINGW-X86-NEXT: .cfi_offset %esi, -12 18; CHECK-MINGW-X86-NEXT: .cfi_offset %edi, -8 19; CHECK-MINGW-X86-NEXT: movb __ZGVZ2amiE2au, %al 20; CHECK-MINGW-X86-NEXT: testb %al, %al 21; CHECK-MINGW-X86-NEXT: jne LBB0_4 22; CHECK-MINGW-X86-NEXT: # %bb.1: # %init.check 23; CHECK-MINGW-X86-NEXT: .cfi_escape 0x2e, 0x04 24; CHECK-MINGW-X86-NEXT: pushl $__ZGVZ2amiE2au 25; CHECK-MINGW-X86-NEXT: .cfi_adjust_cfa_offset 4 26; CHECK-MINGW-X86-NEXT: calll ___cxa_guard_acquire 27; CHECK-MINGW-X86-NEXT: addl $4, %esp 28; CHECK-MINGW-X86-NEXT: .cfi_adjust_cfa_offset -4 29; CHECK-MINGW-X86-NEXT: testl %eax, %eax 30; CHECK-MINGW-X86-NEXT: je LBB0_4 31; CHECK-MINGW-X86-NEXT: # %bb.2: # %init 32; CHECK-MINGW-X86-NEXT: Ltmp0: 33; CHECK-MINGW-X86-NEXT: .cfi_escape 0x2e, 0x04 34; CHECK-MINGW-X86-NEXT: pushl $4 35; CHECK-MINGW-X86-NEXT: .cfi_adjust_cfa_offset 4 36; CHECK-MINGW-X86-NEXT: calll __Znwj 37; CHECK-MINGW-X86-NEXT: addl $4, %esp 38; CHECK-MINGW-X86-NEXT: .cfi_adjust_cfa_offset -4 39; CHECK-MINGW-X86-NEXT: Ltmp1: 40; CHECK-MINGW-X86-NEXT: # %bb.3: # %invoke.cont 41; CHECK-MINGW-X86-NEXT: movl %eax, __ZZ2amiE2au 42; CHECK-MINGW-X86-NEXT: .cfi_escape 0x2e, 0x04 43; CHECK-MINGW-X86-NEXT: pushl $__ZGVZ2amiE2au 44; CHECK-MINGW-X86-NEXT: .cfi_adjust_cfa_offset 4 45; CHECK-MINGW-X86-NEXT: calll ___cxa_guard_release 46; CHECK-MINGW-X86-NEXT: addl $4, %esp 47; CHECK-MINGW-X86-NEXT: .cfi_adjust_cfa_offset -4 48; CHECK-MINGW-X86-NEXT: LBB0_4: # %init.end 49; CHECK-MINGW-X86-NEXT: .cfi_escape 0x2e, 0x04 50; CHECK-MINGW-X86-NEXT: pushl $4 51; CHECK-MINGW-X86-NEXT: .cfi_adjust_cfa_offset 4 52; CHECK-MINGW-X86-NEXT: calll __Znwj 53; CHECK-MINGW-X86-NEXT: addl $4, %esp 54; CHECK-MINGW-X86-NEXT: .cfi_adjust_cfa_offset -4 55; CHECK-MINGW-X86-NEXT: movl %eax, %esi 56; CHECK-MINGW-X86-NEXT: .cfi_escape 0x2e, 0x04 57; CHECK-MINGW-X86-NEXT: pushl $4 58; CHECK-MINGW-X86-NEXT: .cfi_adjust_cfa_offset 4 59; CHECK-MINGW-X86-NEXT: calll ___cxa_allocate_exception 60; CHECK-MINGW-X86-NEXT: addl $4, %esp 61; CHECK-MINGW-X86-NEXT: .cfi_adjust_cfa_offset -4 62; CHECK-MINGW-X86-NEXT: movl $0, (%eax) 63; CHECK-MINGW-X86-NEXT: Ltmp3: 64; CHECK-MINGW-X86-NEXT: .cfi_escape 0x2e, 0x0c 65; CHECK-MINGW-X86-NEXT: movl .refptr.__ZTIi, %ecx 66; CHECK-MINGW-X86-NEXT: pushl $0 67; CHECK-MINGW-X86-NEXT: .cfi_adjust_cfa_offset 4 68; CHECK-MINGW-X86-NEXT: pushl %ecx 69; CHECK-MINGW-X86-NEXT: .cfi_adjust_cfa_offset 4 70; CHECK-MINGW-X86-NEXT: pushl %eax 71; CHECK-MINGW-X86-NEXT: .cfi_adjust_cfa_offset 4 72; CHECK-MINGW-X86-NEXT: calll ___cxa_throw 73; CHECK-MINGW-X86-NEXT: addl $12, %esp 74; CHECK-MINGW-X86-NEXT: .cfi_adjust_cfa_offset -12 75; CHECK-MINGW-X86-NEXT: Ltmp4: 76; CHECK-MINGW-X86-NEXT: # %bb.8: # %unreachable 77; CHECK-MINGW-X86-NEXT: LBB0_5: # %lpad 78; CHECK-MINGW-X86-NEXT: Ltmp2: 79; CHECK-MINGW-X86-NEXT: movl %eax, %edi 80; CHECK-MINGW-X86-NEXT: .cfi_escape 0x2e, 0x04 81; CHECK-MINGW-X86-NEXT: pushl $__ZGVZ2amiE2au 82; CHECK-MINGW-X86-NEXT: .cfi_adjust_cfa_offset 4 83; CHECK-MINGW-X86-NEXT: calll ___cxa_guard_abort 84; CHECK-MINGW-X86-NEXT: jmp LBB0_7 85; CHECK-MINGW-X86-NEXT: LBB0_6: # %lpad1 86; CHECK-MINGW-X86-NEXT: .cfi_def_cfa_offset 12 87; CHECK-MINGW-X86-NEXT: Ltmp5: 88; CHECK-MINGW-X86-NEXT: movl %eax, %edi 89; CHECK-MINGW-X86-NEXT: .cfi_escape 0x2e, 0x04 90; CHECK-MINGW-X86-NEXT: pushl %esi 91; CHECK-MINGW-X86-NEXT: .cfi_adjust_cfa_offset 4 92; CHECK-MINGW-X86-NEXT: calll __ZdlPv 93; CHECK-MINGW-X86-NEXT: LBB0_7: # %eh.resume 94; CHECK-MINGW-X86-NEXT: addl $4, %esp 95; CHECK-MINGW-X86-NEXT: .cfi_adjust_cfa_offset -4 96; CHECK-MINGW-X86-NEXT: .cfi_escape 0x2e, 0x04 97; CHECK-MINGW-X86-NEXT: pushl %edi 98; CHECK-MINGW-X86-NEXT: .cfi_adjust_cfa_offset 4 99; CHECK-MINGW-X86-NEXT: calll __Unwind_Resume 100; CHECK-MINGW-X86-NEXT: Lfunc_end0: 101entry: 102 %1 = load atomic i8, i8* bitcast (i64* @_ZGVZ2amiE2au to i8*) acquire, align 8 103 %guard.uninitialized = icmp eq i8 %1, 0 104 br i1 %guard.uninitialized, label %init.check, label %init.end 105 106init.check: ; preds = %entry 107 %2 = tail call i32 @__cxa_guard_acquire(i64* nonnull @_ZGVZ2amiE2au) 108 %tobool = icmp eq i32 %2, 0 109 br i1 %tobool, label %init.end, label %init 110 111init: ; preds = %init.check 112 %call.i3 = invoke i8* @_Znwj(i32 4) 113 to label %invoke.cont unwind label %lpad 114 115invoke.cont: ; preds = %init 116 store i8* %call.i3, i8** bitcast (%struct.as* @_ZZ2amiE2au to i8**), align 4 117 tail call void @__cxa_guard_release(i64* nonnull @_ZGVZ2amiE2au) 118 br label %init.end 119 120init.end: ; preds = %init.check, %invoke.cont, %entry 121 %call.i = tail call i8* @_Znwj(i32 4) 122 %exception = tail call i8* @__cxa_allocate_exception(i32 4) 123 %3 = bitcast i8* %exception to i32* 124 store i32 0, i32* %3, align 16 125 invoke void @__cxa_throw(i8* %exception, i8* bitcast (i8** @_ZTIi to i8*), i8* null) 126 to label %unreachable unwind label %lpad1 127 128lpad: ; preds = %init 129 %4 = landingpad { i8*, i32 } 130 cleanup 131 %5 = extractvalue { i8*, i32 } %4, 0 132 %6 = extractvalue { i8*, i32 } %4, 1 133 tail call void @__cxa_guard_abort(i64* nonnull @_ZGVZ2amiE2au) #1 134 br label %eh.resume 135 136lpad1: ; preds = %init.end 137 %7 = landingpad { i8*, i32 } 138 cleanup 139 %8 = extractvalue { i8*, i32 } %7, 0 140 %9 = extractvalue { i8*, i32 } %7, 1 141 tail call void @_ZdlPv(i8* nonnull %call.i) 142 br label %eh.resume 143 144eh.resume: ; preds = %lpad1, %lpad 145 %exn.slot.0 = phi i8* [ %8, %lpad1 ], [ %5, %lpad ] 146 %ehselector.slot.0 = phi i32 [ %9, %lpad1 ], [ %6, %lpad ] 147 %lpad.val = insertvalue { i8*, i32 } undef, i8* %exn.slot.0, 0 148 %lpad.val2 = insertvalue { i8*, i32 } %lpad.val, i32 %ehselector.slot.0, 1 149 resume { i8*, i32 } %lpad.val2 150 151unreachable: ; preds = %init.end 152 unreachable 153} 154 155declare i32 @__cxa_guard_acquire(i64*) 156declare i32 @__gxx_personality_v0(...) 157declare void @__cxa_guard_abort(i64*) 158declare void @__cxa_guard_release(i64*) 159declare i8* @__cxa_allocate_exception(i32) 160declare void @__cxa_throw(i8*, i8*, i8*) 161declare noalias nonnull i8* @_Znwj(i32) 162declare i8* @__cxa_begin_catch(i8*) 163declare void @__cxa_end_catch() 164declare void @_ZdlPv(i8*) 165