[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CodeGen / thinlto-clang-diagnostic-handler-in-be.c
blobefbcc851ad77049344d74043f59c0e0d583564fa
1 // Test clang diagnositic handler works in IR file compilation.
3 // REQUIRES: x86-registered-target
5 // RUN: llvm-profdata merge -o %t1.profdata %S/Inputs/thinlto_expect1.proftext
6 // RUN: %clang -target x86_64-linux-gnu -O2 -flto=thin -g -fprofile-use=%t1.profdata -c -o %t1.bo %s
7 // RUN: llvm-lto -thinlto -o %t %t1.bo
8 // RUN: %clang_cc1 -triple x86_64-linux-gnu -O2 -x ir %t1.bo -fthinlto-index=%t.thinlto.bc -emit-obj -Rpass-analysis=info 2>&1 | FileCheck %s -check-prefix=CHECK-REMARK
9 // RUN: llvm-profdata merge -o %t2.profdata %S/Inputs/thinlto_expect2.proftext
10 // RUN: %clang_cc1 -triple x86_64-linux-gnu -O2 -x ir %t1.bo -fthinlto-index=%t.thinlto.bc -fprofile-instrument-use-path=%t2.profdata -emit-obj 2>&1 | FileCheck %s -allow-empty -check-prefix=CHECK-NOWARNING
12 int sum;
13 __attribute__((noinline)) void bar(void) {
14 sum = 1234;
17 __attribute__((noinline)) void foo(int m) {
18 if (__builtin_expect(m > 9, 1))
19 bar();
21 // CHECK-REMARK: remark: {{.*}}.c:
22 // CHECK-NOWARNING-NOT: warning: {{.*}}.c:{{[0-9]*}}:26: 50.00% (12 / 24)