annotate test/Other/cgscc-disconnected-invalidation.ll @ 129:9ec641e857f8

Fix compile error to update llvm 5.0
author mir3636
date Tue, 12 Dec 2017 19:42:58 +0900
parents 803732b1fca8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1 ; Test that patterns of transformations which disconnect a region of the call
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
2 ; graph mid-traversal and then invalidate it function correctly.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
3 ;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
4 ; RUN: opt -S -passes='cgscc(inline,function(simplify-cfg))' < %s | FileCheck %s
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
5
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6 define internal void @test_scc_internal(i1 %flag) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7 ; CHECK-NOT: @test_scc_internal
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8 entry:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9 br i1 %flag, label %then, label %else
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11 then:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12 call void @test_scc_internal(i1 false)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13 call void @test_scc_external()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14 br label %else
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16 else:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20 define void @test_scc_external() {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21 ; CHECK-LABEL: define void @test_scc_external()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22 entry:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23 call void @test_scc_internal(i1 false)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
26
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27 define internal void @test_refscc_internal(i1 %flag, i8* %ptr) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28 ; CHECK-NOT: @test_refscc_internal
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29 entry:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30 br i1 %flag, label %then, label %else
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32 then:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33 call void @test_refscc_internal(i1 false, i8* bitcast (i8* ()* @test_refscc_external to i8*))
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34 br label %else
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
36 else:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40 define i8* @test_refscc_external() {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41 ; CHECK-LABEL: define i8* @test_refscc_external()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
42 entry:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
43 br i1 true, label %then, label %else
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
44 ; CHECK-NEXT: entry:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
45 ; CHECK-NEXT: ret i8* null
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
46 ; CHECK-NEXT: }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
47 ; CHECK-NOT: @test_refscc_internal
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
48
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
49 then:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
50 ret i8* null
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
51
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
52 else:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
53 ret i8* bitcast (void (i1, i8*)* @test_refscc_internal to i8*)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
54 }