[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

Jessica Paquette via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 8 20:02:13 PST 2024


================
@@ -98,3 +104,49 @@ int main() {                    // CHECK: File 0, [[@LINE]]:12 -> {{[0-9]+}}:2 =
 void ternary() {
   true ? FOO : FOO; // CHECK-NOT: Gap,{{.*}}, [[@LINE]]:8 ->
 }
+
+// FIXME: Do not generate coverage for discarded branches in if consteval
+// GH-57377
+// CHECK-LABEL: _Z16check_constevalAi:
+constexpr int check_constevalA(int i) { // CHECK-NEXT: [[@LINE]]:39 -> {{[0-9]+}}:2 = #0
----------------
ornata wrote:

Maybe `check_if_consteval_with_discarded_branch` would be a better name?

https://github.com/llvm/llvm-project/pull/77214


More information about the cfe-commits mailing list