1; RUN: llc < %s -mtriple=x86_64-unknown-freebsd8.1 -o /dev/null 2; This formerly crashed, PR 8154. 3 4module asm ".weak sem_close" 5module asm ".equ sem_close, _sem_close" 6module asm ".weak sem_destroy" 7module asm ".equ sem_destroy, _sem_destroy" 8module asm ".weak sem_getvalue" 9module asm ".equ sem_getvalue, _sem_getvalue" 10module asm ".weak sem_init" 11module asm ".equ sem_init, _sem_init" 12module asm ".weak sem_open" 13module asm ".equ sem_open, _sem_open" 14module asm ".weak sem_post" 15module asm ".equ sem_post, _sem_post" 16module asm ".weak sem_timedwait" 17module asm ".equ sem_timedwait, _sem_timedwait" 18module asm ".weak sem_trywait" 19module asm ".equ sem_trywait, _sem_trywait" 20module asm ".weak sem_unlink" 21module asm ".equ sem_unlink, _sem_unlink" 22module asm ".weak sem_wait" 23module asm ".equ sem_wait, _sem_wait" 24 25%struct._sem = type { i32, %struct._usem } 26%struct._usem = type { i32, i32, i32 } 27 28define void @_sem_timedwait(%struct._sem* noalias %sem) nounwind ssp { 29entry: 30 br i1 undef, label %while.cond.preheader, label %sem_check_validity.exit 31 32while.cond.preheader: ; preds = %entry 33 %tmp4 = getelementptr inbounds %struct._sem, %struct._sem* %sem, i64 0, i32 1, i32 1 34 br label %while.cond 35 36sem_check_validity.exit: ; preds = %entry 37 ret void 38 39while.cond: ; preds = %while.body, %while.cond.preheader 40 br i1 undef, label %while.body, label %while.end 41 42while.body: ; preds = %while.cond 43 %0 = call i8 asm sideeffect "\09lock ; \09\09\09cmpxchgl $2,$1 ;\09 sete\09$0 ;\09\091:\09\09\09\09# atomic_cmpset_int", "={ax},=*m,r,{ax},*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* %tmp4, i32 undef, i32 undef, i32* %tmp4) nounwind, !srcloc !0 44 br i1 undef, label %while.cond, label %return 45 46while.end: ; preds = %while.cond 47 br i1 undef, label %if.end18, label %return 48 49if.end18: ; preds = %while.end 50 unreachable 51 52return: ; preds = %while.end, %while.body 53 ret void 54} 55 56!0 = !{i32 158484} 57