1 // Test to ensure RHS condition of logical operators isn't evaluated more than
2 // one time when instrumenting RHS counter blocks for branch coverage.
4 // RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++11 -main-file-name branch-profdup.cpp %s -o - -emit-llvm -fprofile-instrument=clang | FileCheck -allow-deprecated-dag-overlap %s
6 // CHECK-LABEL: define {{.*}}@_Z5test1b
7 // CHECK-COUNT-1: = call {{.*}}@_Z5fval1v()
8 // CHECK-NOT: = call {{.*}}@_Z5fval1v()
11 return (a
&& fval1());
14 // CHECK-LABEL: define {{.*}}@_Z5test2b
15 // CHECK-COUNT-1: call {{.*}}_Z5fval2v()
16 // CHECK-NOT: call {{.*}}_Z5fval2v()
19 return (a
|| fval2());
22 // CHECK-LABEL: define {{.*}}@_Z5test3v
23 // CHECK-COUNT-1: call {{.*}}_Z5fval3v()
24 // CHECK-NOT: call {{.*}}_Z5fval3v()
27 return (1 && fval3());
30 // CHECK-LABEL: define {{.*}}@_Z5test4v
31 // CHECK-COUNT-1: call {{.*}}_Z5fval4v()
32 // CHECK-NOT: call {{.*}}_Z5fval4v()
35 return (0 || fval4());
38 // CHECK-LABEL: define {{.*}}@_Z5test5b
39 // CHECK-COUNT-1: call {{.*}}_Z5fval5v()
40 // CHECK-NOT: call {{.*}}_Z5fval5v()
48 // CHECK-LABEL: define {{.*}}@_Z5test6b
49 // CHECK-COUNT-1: call {{.*}}_Z5fval6v()
50 // CHECK-NOT: call {{.*}}_Z5fval6v()
58 // CHECK-LABEL: define {{.*}}@_Z5test7v
59 // CHECK-COUNT-1: call {{.*}}_Z5fval7v()
60 // CHECK-NOT: call {{.*}}_Z5fval7v()
68 // CHECK-LABEL: define {{.*}}@_Z5test8v
69 // CHECK-COUNT-1: call {{.*}}_Z5fval8v()
70 // CHECK-NOT: call {{.*}}_Z5fval8v()