1// Test that optimized flag is properly included in DWARF.
2
3// -gsplit-dwarf is supported only on Linux.
4// REQUIRES: system-linux
5
6// This test uses lldb's embedded python interpreter
7// REQUIRES: python
8
9// RUN: %clang_host %s -fno-standalone-debug -glldb \
10// RUN: -gdwarf-5 -gpubnames -gsplit-dwarf -O3 -c -o %t1.o
11
12// RUN: llvm-dwarfdump %t1.o | FileCheck %s --check-prefix DWARFDUMP_O
13// RUN: llvm-dwarfdump %t1.dwo | FileCheck %s --check-prefix DWARFDUMP_DWO
14// RUN: %lldb -b -o 'script lldb.SBDebugger.Create().CreateTarget("%t1.o").FindFunctions("main",lldb.eFunctionNameTypeAuto).GetContextAtIndex(0).GetFunction().GetIsOptimized()' | FileCheck %s
15
16// DWARFDUMP_O-NOT: DW_AT_APPLE_optimized
17//
18// DWARFDUMP_DWO: DW_TAG_compile_unit
19// DWARFDUMP_DWO-NOT: DW_TAG_
20// DWARFDUMP_DWO: DW_AT_APPLE_optimized (true)
21
22// CHECK: (lldb) script lldb.SBDebugger.Create()
23// CHECK-NEXT: True
24
25int main(void) { return 0; }
26

source code of lldb/test/Shell/SymbolFile/DWARF/split-optimized.c