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