xref: /llvm-project/llvm/test/CodeGen/Generic/dag-combine-ossfuzz-crash.ll (revision 0e8bd5a44a1bd8034706189b49a7a816c59304cd)
1; RUN: llc < %s
2; XFAIL: target=avr{{.*}}
3
4; llc built with address sanitizer crashes because of a dangling node pointer
5; oss-fuzz -  DAGCombiner::useDivRem (5011)
6
7define void @f() {
8BB:
9  %A19 = alloca ptr
10  %C18 = icmp ugt i1 true, false
11  %L13 = load i8, ptr undef
12  %L10 = load i8, ptr undef
13  %B12 = and i8 %L13, %L10
14  %B35 = and i8 %B12, %L10
15  %L2 = load ptr, ptr undef
16  %L23 = load i66, ptr %L2
17  %B38 = urem i8 %B35, %B12
18  %B9 = ashr i66 %L23, %L23
19  %C11 = icmp sge i8 %B38, %B35
20  %A4 = alloca i66
21  %G4 = getelementptr i66, ptr %A4, i1 true
22  %L6 = load i66, ptr %G4
23  %B21 = urem i1 %C11, true
24  %B1 = mul i66 %B9, %L23
25  %B5 = udiv i8 %L10, %L13
26  %B22 = udiv i66 %B9, %B1
27  %C29 = icmp ult i32 -1, 0
28  store ptr undef, ptr undef
29  store i1 %C29, ptr undef
30  br label %BB1
31
32BB1:                                              ; preds = %BB
33  %G8 = getelementptr i66, ptr undef, i16 32767
34  %G43 = getelementptr i66, ptr undef, i66 -1
35  %L20 = load i1, ptr undef
36  %B7 = and i66 %L6, %L6
37  %B30 = sdiv i66 -36893488147419103232, -1
38  %B16 = urem i66 %B22, %L6
39  %G47 = getelementptr i66, ptr %G8, i66 %B16
40  store i66 %B7, ptr %G47
41  store i8 %B5, ptr undef
42  %C5 = icmp ult i1 %C18, %L20
43  store i66 %B30, ptr %G47
44  store ptr undef, ptr %A19
45  store i1 %C5, ptr undef
46  store i1 %C11, ptr undef
47  store ptr %G43, ptr undef
48  store i1 %B21, ptr undef
49  %G59 = getelementptr i1, ptr undef, i1 false
50  %G61 = getelementptr i66, ptr %G8, i1 %L20
51  store i1 %L20, ptr %G59
52  store ptr %G61, ptr undef
53  ret void
54}
55