1 // Test that optimized flag is properly included in DWARF.
3 // -gsplit-dwarf is supported only on Linux.
4 // REQUIRES: system-linux
6 // This test uses lldb's embedded python interpreter
9 // RUN: %clang_host %s -fno-standalone-debug -glldb \
10 // RUN: -gdwarf-5 -gpubnames -gsplit-dwarf -O3 -c -o %t1.o
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
16 // DWARFDUMP_O-NOT: DW_AT_APPLE_optimized
18 // DWARFDUMP_DWO: DW_TAG_compile_unit
19 // DWARFDUMP_DWO-NOT: DW_TAG_
20 // DWARFDUMP_DWO: DW_AT_APPLE_optimized (true)
22 // CHECK: (lldb) script lldb.SBDebugger.Create()
25 int main(void) { return 0; }