1; This is really testing that instcombine preserves analyses correctly, so we
2; don't care much about the code other than it is something instcombine can
3; transform.
4;
5; RUN: opt < %s -disable-output -debug-pass-manager 2>&1 -aa-pipeline=basic-aa,globals-aa \
6; RUN:    -passes='require<globals-aa>,function(require<aa>,instcombine),function(require<aa>)' \
7; RUN:    | FileCheck %s --check-prefix=AA
8; AA: Running analysis: GlobalsAA
9; AA: Running analysis: AAManager
10; AA: Running analysis: BasicAA
11; AA: Running pass: InstCombinePass on test
12; AA-NOT: Invalidating analysis: GlobalsAA
13; AA-NOT: Invalidating analysis: AAmanager
14; AA-NOT: Invalidating analysis: BasicAA
15; AA: Running pass: RequireAnalysisPass<{{.*}}AAManager
16; AA-NOT: Running analysis: GlobalsAA
17; AA-NOT: Running analysis: AAmanager
18; AA-NOT: Running analysis: BasicAA
19;
20; RUN: opt < %s -disable-output -debug-pass-manager 2>&1 \
21; RUN:    -passes='require<domtree>,instcombine,require<domtree>' \
22; RUN:    | FileCheck %s --check-prefix=DT
23; DT: Running analysis: DominatorTreeAnalysis
24; DT: Running pass: InstCombinePass on test
25; DT-NOT: Invalidating analysis: DominatorTreeAnalysis
26; DT: Running pass: RequireAnalysisPass<{{.*}}DominatorTreeAnalysis
27; DT-NOT: Running analysis: DominatorTreeAnalysis
28
29define i32 @test(i32 %A) {
30  %B = add i32 %A, 5
31  %C = add i32 %B, -5
32  ret i32 %C
33}
34