Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / discard-name-values.cpp
blob91328a4ddade3681e49a1e196fe8cf20d6300d8f
1 // RUN: %clang_cc1 -emit-llvm -triple=armv7-apple-darwin -std=c++11 %s -o - -O1 \
2 // RUN: | FileCheck %s
3 // RUN: %clang_cc1 -emit-llvm -triple=armv7-apple-darwin -std=c++11 %s -o - -O1 \
4 // RUN: -discard-value-names | FileCheck %s --check-prefix=DISCARDVALUE
6 extern "C" void branch();
8 bool test(bool pred) {
9 // DISCARDVALUE: br i1 %0, label %2, label %3
10 // CHECK: br i1 %pred, label %if.then, label %if.end
12 if (pred) {
13 // DISCARDVALUE: 2:
14 // DISCARDVALUE-NEXT: call void @branch()
15 // DISCARDVALUE-NEXT: br label %3
17 // CHECK: if.then:
18 // CHECK-NEXT: call void @branch()
19 // CHECK-NEXT: br label %if.end
20 branch();
23 // DISCARDVALUE: 3:
24 // DISCARDVALUE-NEXT: ret i1 %0
26 // CHECK: if.end:
27 // CHECK-NEXT: ret i1 %pred
28 return pred;