xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/2010-09-16-asmcrash.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=x86_64-unknown-freebsd8.1 -o /dev/null
2*9880d681SAndroid Build Coastguard Worker; This formerly crashed, PR 8154.
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Workermodule asm ".weak sem_close"
5*9880d681SAndroid Build Coastguard Workermodule asm ".equ sem_close, _sem_close"
6*9880d681SAndroid Build Coastguard Workermodule asm ".weak sem_destroy"
7*9880d681SAndroid Build Coastguard Workermodule asm ".equ sem_destroy, _sem_destroy"
8*9880d681SAndroid Build Coastguard Workermodule asm ".weak sem_getvalue"
9*9880d681SAndroid Build Coastguard Workermodule asm ".equ sem_getvalue, _sem_getvalue"
10*9880d681SAndroid Build Coastguard Workermodule asm ".weak sem_init"
11*9880d681SAndroid Build Coastguard Workermodule asm ".equ sem_init, _sem_init"
12*9880d681SAndroid Build Coastguard Workermodule asm ".weak sem_open"
13*9880d681SAndroid Build Coastguard Workermodule asm ".equ sem_open, _sem_open"
14*9880d681SAndroid Build Coastguard Workermodule asm ".weak sem_post"
15*9880d681SAndroid Build Coastguard Workermodule asm ".equ sem_post, _sem_post"
16*9880d681SAndroid Build Coastguard Workermodule asm ".weak sem_timedwait"
17*9880d681SAndroid Build Coastguard Workermodule asm ".equ sem_timedwait, _sem_timedwait"
18*9880d681SAndroid Build Coastguard Workermodule asm ".weak sem_trywait"
19*9880d681SAndroid Build Coastguard Workermodule asm ".equ sem_trywait, _sem_trywait"
20*9880d681SAndroid Build Coastguard Workermodule asm ".weak sem_unlink"
21*9880d681SAndroid Build Coastguard Workermodule asm ".equ sem_unlink, _sem_unlink"
22*9880d681SAndroid Build Coastguard Workermodule asm ".weak sem_wait"
23*9880d681SAndroid Build Coastguard Workermodule asm ".equ sem_wait, _sem_wait"
24*9880d681SAndroid Build Coastguard Worker
25*9880d681SAndroid Build Coastguard Worker%struct._sem = type { i32, %struct._usem }
26*9880d681SAndroid Build Coastguard Worker%struct._usem = type { i32, i32, i32 }
27*9880d681SAndroid Build Coastguard Worker
28*9880d681SAndroid Build Coastguard Workerdefine void @_sem_timedwait(%struct._sem* noalias %sem) nounwind ssp {
29*9880d681SAndroid Build Coastguard Workerentry:
30*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %while.cond.preheader, label %sem_check_validity.exit
31*9880d681SAndroid Build Coastguard Worker
32*9880d681SAndroid Build Coastguard Workerwhile.cond.preheader:                             ; preds = %entry
33*9880d681SAndroid Build Coastguard Worker  %tmp4 = getelementptr inbounds %struct._sem, %struct._sem* %sem, i64 0, i32 1, i32 1
34*9880d681SAndroid Build Coastguard Worker  br label %while.cond
35*9880d681SAndroid Build Coastguard Worker
36*9880d681SAndroid Build Coastguard Workersem_check_validity.exit:                          ; preds = %entry
37*9880d681SAndroid Build Coastguard Worker  ret void
38*9880d681SAndroid Build Coastguard Worker
39*9880d681SAndroid Build Coastguard Workerwhile.cond:                                       ; preds = %while.body, %while.cond.preheader
40*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %while.body, label %while.end
41*9880d681SAndroid Build Coastguard Worker
42*9880d681SAndroid Build Coastguard Workerwhile.body:                                       ; preds = %while.cond
43*9880d681SAndroid Build Coastguard Worker  %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*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %while.cond, label %return
45*9880d681SAndroid Build Coastguard Worker
46*9880d681SAndroid Build Coastguard Workerwhile.end:                                        ; preds = %while.cond
47*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %if.end18, label %return
48*9880d681SAndroid Build Coastguard Worker
49*9880d681SAndroid Build Coastguard Workerif.end18:                                         ; preds = %while.end
50*9880d681SAndroid Build Coastguard Worker  unreachable
51*9880d681SAndroid Build Coastguard Worker
52*9880d681SAndroid Build Coastguard Workerreturn:                                           ; preds = %while.end, %while.body
53*9880d681SAndroid Build Coastguard Worker  ret void
54*9880d681SAndroid Build Coastguard Worker}
55*9880d681SAndroid Build Coastguard Worker
56*9880d681SAndroid Build Coastguard Worker!0 = !{i32 158484}
57