[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Frontend / embed-bitcode-noopt.c
blob437be11879365f29b4074d5778093eda37b10911
1 // Ensure calling bypassing the driver with -fembed-bitcode embeds bitcode pre-
2 // optimizations
3 // REQUIRES: x86-registered-target
4 // RUN: %clang_cc1 %s -O2 -emit-obj -triple=x86_64-unknown-linux-gnu -o %t.o -fembed-bitcode=all
5 // RUN: llvm-objcopy --dump-section=.llvmbc=%t.bc %t.o /dev/null
7 // Also check that the .llvmcmd section captures the optimization options.
8 // RUN: llvm-dis %t.bc -o - | FileCheck %s --check-prefix=CHECK-BC
9 // RUN: llvm-objcopy --dump-section=.llvmcmd=- %t.o /dev/null | FileCheck %s --check-prefix=CHECK-CMD
11 // CHECK-BC-LABEL: define{{.*}} void @bar() #0 {
12 // CHECK-BC-NEXT: entry:
13 // CHECK-BC-NEXT: ret void
14 // CHECK-BC-NEXT: }
15 // CHECK-BC-LABEL: define{{.*}} void @foo() #1 {
16 // CHECK-BC-NEXT: entry:
17 // CHECK-BC-NEXT: call void @bar()
18 // CHECK-BC-NEXT: ret void
19 // CHECK-BC-NEXT: }
20 // CHECK-BC-LABEL: attributes #0 = {{.*}} alwaysinline
21 // CHECK-CMD: -O2
23 __attribute__((always_inline)) void bar(void) {
24 return;
27 void foo(void) {
28 bar();
29 return;