1; Ensure calling bypassing the driver with -fembed-bitcode embeds bitcode pre-
2; optimizations
3
4; RUN: %clang_cc1 -O2 -triple x86_64-unknown-linux-gnu -emit-obj %s -o %t.o -fembed-bitcode=all
5; RUN: llvm-objcopy --dump-section=.llvmbc=%t.bc %t.o /dev/null
6
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
10
11; CHECK-BC-LABEL: define void @bar() #0 {
12; CHECK-BC-NEXT:  ret void
13; CHECK-BC-NEXT: }
14; CHECK-BC-LABEL: define void @foo() {
15; CHECK-BC-NEXT: call void @bar()
16; CHECK-BC-NEXT: ret void
17; CHECK-BC-NEXT: }
18; CHECK-BC-LABEL: attributes #0 = { alwaysinline }
19; CHECK-CMD: -O2
20
21define void @bar() #0 {
22    ret void
23}
24
25define void @foo() {
26  call void @bar()
27  ret void
28}
29
30attributes #0 = { alwaysinline }
31