xref: /llvm-project/clang/test/CodeGen/code-coverage.c (revision 8522ba845f8a824e2142e21ee71b2900c42f929e)
1 // RUN: %clang_cc1 -emit-llvm -disable-red-zone -femit-coverage-data %s -o - | FileCheck %s
2 
3 // <rdar://problem/12843084>
4 
5 int test1(int a) {
6   switch (a % 2) {
7   case 0:
8     ++a;
9   case 1:
10     a /= 2;
11   }
12   return a;
13 }
14 
15 // Check that the noredzone flag is set on the generated functions.
16 
17 // CHECK: void @__llvm_gcov_indirect_counter_increment(i32* %{{.*}}, i64** %{{.*}}) unnamed_addr noinline noredzone
18 // CHECK: void @__llvm_gcov_writeout() unnamed_addr noinline noredzone
19 // CHECK: void @__llvm_gcov_init() unnamed_addr noinline noredzone
20 // CHECK: void @__gcov_flush() unnamed_addr noinline noredzone
21