1 ; RUN: opt -basic-aa -aa -memoryssa -early-cse-memssa -verify -S < %s | FileCheck %s
3 ; Check that this doesn't crash. The crash only happens with expensive checks,
4 ; but there doesn't seem to be a REQUIRES for that.
6 ; CHECK: invoke void @f1
8 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
9 target triple = "x86_64-unknown-linux-gnu"
13 %s.2 = type { %s.3, %s.6, %s.16 }
14 %s.3 = type { %s.4, %s.5 }
15 %s.4 = type { i32 (...)**, i64 }
16 %s.5 = type { i32 (...)** }
17 %s.6 = type <{ %s.7, %s.10, i8*, i32, [4 x i8] }>
18 %s.7 = type { i32 (...)**, %s.8, i8*, i8*, i8*, i8*, i8*, i8* }
21 %s.10 = type { %s.11 }
22 %s.11 = type { %s.12 }
23 %s.12 = type { %s.13 }
24 %s.13 = type { %s.14 }
25 %s.14 = type { %s.15 }
26 %s.15 = type { i64, i64, i8* }
27 %s.16 = type <{ %s.17, %s.18*, i32 }>
28 %s.17 = type { i32 (...)**, i32, i64, i64, i32, i32, i8*, i8*, void (i32, %s.17*, i32)**, i32*, i64, i64, i64*, i64, i64, i8**, i64, i64 }
29 %s.18 = type { i32 (...)**, %s.16 }
30 %s.19 = type { i8, %s.20 }
31 %s.20 = type { %s.21 }
32 %s.21 = type { %s.22*, %s.24, %s.26 }
33 %s.22 = type { %s.23* }
34 %s.23 = type <{ %s.22, %s.23*, %s.22*, i8, [7 x i8] }>
35 %s.24 = type { %s.25 }
36 %s.25 = type { %s.22 }
37 %s.26 = type { %s.27 }
40 @g0 = external constant [1 x i8], align 1
44 ; Function Attrs: uwtable
45 declare void @f1(%s.0* nocapture) align 2
47 declare void @f2(%s.10*, %s.2*)
49 declare void @f3(%s.10*, i8*, i32)
51 define i8* @f4(%s.19* %a0, i8* %a1, i32 %a2, i8* %a3) align 2 personality i8* bitcast (i32 (...)* @f0 to i8*) {
53 %v0 = alloca %s.0, align 8
57 invoke void @f5(%s.10* nonnull sret(%s.10) align 8 undef, i8* nonnull undef)
58 to label %b6 unwind label %b3
61 %v1 = invoke nonnull align 8 dereferenceable(24) %s.10* @f6(%s.10* undef, i64 undef, i64 1)
62 to label %b2 unwind label %b4
65 %v2 = landingpad { i8*, i32 }
70 %v3 = landingpad { i8*, i32 }
74 b5: ; preds = %b4, %b3
75 resume { i8*, i32 } undef
78 invoke void @f1(%s.0* nonnull %v0)
79 to label %b8 unwind label %b7
82 %v4 = landingpad { i8*, i32 }
87 invoke void @f2(%s.10* sret(%s.10) align 8 undef, %s.2* undef)
88 to label %b10 unwind label %b14
90 b9: ; No predecessors!
94 %v6 = invoke i32 @f7(%s.10* nonnull undef, i64 0, i64 -1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @g0, i64 0, i64 0), i64 undef)
95 to label %b12 unwind label %b11
98 %v7 = landingpad { i8*, i32 }
103 invoke void @f3(%s.10* nonnull sret(%s.10) align 8 undef, i8* %a1, i32 %a2)
104 to label %b13 unwind label %b15
110 %v8 = landingpad { i8*, i32 }
115 %v9 = landingpad { i8*, i32 }
119 b16: ; preds = %b15, %b14, %b9
120 %v10 = getelementptr inbounds %s.0, %s.0* %v0, i64 0, i32 0
121 %v11 = getelementptr inbounds %s.1, %s.1* %v10, i64 0, i32 0
125 %v12 = load %s.2*, %s.2** %v11, align 8
129 call void undef(%s.2* nonnull %v12)
133 store %s.2* null, %s.2** %v11, align 8
136 b20: ; preds = %b19, %b7
137 resume { i8*, i32 } undef
140 declare hidden void @f5(%s.10*, i8*)
142 declare %s.10* @f6(%s.10*, i64, i64)
144 declare i32 @f7(%s.10*, i64, i64, i8*, i64)