You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
785 B
30 lines
785 B
// RUN: %clang_cc1 -emit-llvm -triple=armv7-apple-darwin -std=c++11 %s -o - -O1 \
|
|
// RUN: | FileCheck %s
|
|
// RUN: %clang_cc1 -emit-llvm -triple=armv7-apple-darwin -std=c++11 %s -o - -O1 \
|
|
// RUN: -discard-value-names | FileCheck %s --check-prefix=DISCARDVALUE
|
|
|
|
extern "C" void branch();
|
|
|
|
bool test(bool pred) {
|
|
// DISCARDVALUE: br i1 %0, label %2, label %3
|
|
// CHECK: br i1 %pred, label %if.then, label %if.end
|
|
|
|
if (pred) {
|
|
// DISCARDVALUE: 2:
|
|
// DISCARDVALUE-NEXT: call void @branch()
|
|
// DISCARDVALUE-NEXT: br label %3
|
|
|
|
// CHECK: if.then:
|
|
// CHECK-NEXT: call void @branch()
|
|
// CHECK-NEXT: br label %if.end
|
|
branch();
|
|
}
|
|
|
|
// DISCARDVALUE: 3:
|
|
// DISCARDVALUE-NEXT: ret i1 %0
|
|
|
|
// CHECK: if.end:
|
|
// CHECK-NEXT: ret i1 %pred
|
|
return pred;
|
|
}
|