1 ; RUN: opt -passes='early-cse<memssa>' -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 { ptr, i64 }
17 %s.6 = type <{ %s.7, %s.10, ptr, i32, [4 x i8] }>
18 %s.7 = type { ptr, %s.8, ptr, ptr, ptr, ptr, ptr, ptr }
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, ptr }
27 %s.16 = type <{ %s.17, ptr, i32 }>
28 %s.17 = type { ptr, i32, i64, i64, i32, i32, ptr, ptr, ptr, ptr, i64, i64, ptr, i64, i64, ptr, i64, i64 }
29 %s.18 = type { ptr, %s.16 }
30 %s.19 = type { i8, %s.20 }
31 %s.20 = type { %s.21 }
32 %s.21 = type { ptr, %s.24, %s.26 }
34 %s.23 = type <{ %s.22, ptr, ptr, 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(ptr nocapture) align 2
47 declare void @f2(ptr, ptr)
49 declare void @f3(ptr, ptr, i32)
51 define ptr @f4(ptr %a0, ptr %a1, i32 %a2, ptr %a3) align 2 personality ptr @f0 {
53 %v0 = alloca %s.0, align 8
57 invoke void @f5(ptr nonnull sret(%s.10) align 8 undef, ptr nonnull undef)
58 to label %b6 unwind label %b3
61 %v1 = invoke nonnull align 8 dereferenceable(24) ptr @f6(ptr undef, i64 undef, i64 1)
62 to label %b2 unwind label %b4
65 %v2 = landingpad { ptr, i32 }
70 %v3 = landingpad { ptr, i32 }
74 b5: ; preds = %b4, %b3
75 resume { ptr, i32 } undef
78 invoke void @f1(ptr nonnull %v0)
79 to label %b8 unwind label %b7
82 %v4 = landingpad { ptr, i32 }
87 invoke void @f2(ptr sret(%s.10) align 8 undef, ptr undef)
88 to label %b10 unwind label %b14
90 b9: ; No predecessors!
94 %v6 = invoke i32 @f7(ptr nonnull undef, i64 0, i64 -1, ptr @g0, i64 undef)
95 to label %b12 unwind label %b11
98 %v7 = landingpad { ptr, i32 }
103 invoke void @f3(ptr nonnull sret(%s.10) align 8 undef, ptr %a1, i32 %a2)
104 to label %b13 unwind label %b15
110 %v8 = landingpad { ptr, i32 }
115 %v9 = landingpad { ptr, i32 }
119 b16: ; preds = %b15, %b14, %b9
123 %v12 = load ptr, ptr %v0, align 8
127 call void undef(ptr nonnull %v12)
131 store ptr null, ptr %v0, align 8
134 b20: ; preds = %b19, %b7
135 resume { ptr, i32 } undef
138 declare hidden void @f5(ptr, ptr)
140 declare ptr @f6(ptr, i64, i64)
142 declare i32 @f7(ptr, i64, i64, ptr, i64)