xref: /llvm-project/clang/test/CodeGen/verify-each.c (revision da7f212f4a7ac8d99c9368770b9af3b628fd4e9f)
1 // Test to ensure -llvm-verify-each works.
2 // REQUIRES: x86-registered-target
3 
4 // RUN: %clang_cc1 -O2 -o /dev/null -triple x86_64-unknown-linux-gnu -emit-llvm-bc %s -fdebug-pass-manager 2>&1 | FileCheck %s --check-prefix=NO
5 // NO-NOT: Verifying
6 
7 // RUN: %clang_cc1 -O2 -o /dev/null -triple x86_64-unknown-linux-gnu -emit-llvm-bc %s -fdebug-pass-manager -llvm-verify-each 2>&1 | FileCheck %s
8 
9 // RUN: %clang_cc1 -O2 -o %t.o -flto=thin -triple x86_64-unknown-linux-gnu -emit-llvm-bc %s -fdebug-pass-manager -llvm-verify-each 2>&1 | FileCheck %s
10 // RUN: llvm-lto -thinlto -o %t %t.o
11 
12 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-obj -O2 -o /dev/null -x ir %t.o -fthinlto-index=%t.thinlto.bc -fdebug-pass-manager -llvm-verify-each 2>&1 | FileCheck %s
13 
14 // CHECK: Verifying function foo
15 // CHECK: Running pass: InstCombinePass
16 // CHECK: Verifying function foo
17 
foo(void)18 void foo(void) {
19 }
20