1 ; RUN: opt < %s -gvn-hoist -S | FileCheck %s
3 @g = external constant i8*
5 declare i32 @gxx_personality(...)
10 ; Make sure opt won't crash and that the load
11 ; is not hoisted from label6 to label4
15 define void @func() personality i8* bitcast (i32 (...)* @gxx_personality to i8*) {
17 to label %3 unwind label %1
20 %2 = landingpad { i8*, i32 }
21 catch i8* bitcast (i8** @g to i8*)
26 br i1 undef, label %4, label %10
29 ;CHECK-NEXT: %5 = load i32*, i32** undef, align 8
30 ;CHECK-NEXT: invoke void @f1()
33 %5 = load i32*, i32** undef, align 8
35 to label %6 unwind label %1
38 ;CHECK-NEXT: %7 = load i32*, i32** undef, align 8
39 ;CHECK-NEXT: %8 = load i32*, i32** undef, align 8
42 %7 = load i32*, i32** undef, align 8
43 %8 = load i32*, i32** undef, align 8
44 br i1 true, label %9, label %17
48 to label %10 unwind label %1
52 to label %11 unwind label %1
55 %12 = invoke signext i32 undef(i32* null, i32 signext undef, i1 zeroext undef)
56 to label %13 unwind label %14
62 %15 = landingpad { i8*, i32 }
63 catch i8* bitcast (i8** @g to i8*)
73 ; uselistorder directives
74 uselistorder void ()* @f0, { 1, 0 }
75 uselistorder label %1, { 0, 3, 1, 2 }