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 // ObjectFileELF::ApplyRelocations does not implement arm32.
10 // XFAIL: target-arm && linux-gnu
11
12 // RUN: %clang_host %s -fno-standalone-debug -glldb \
13 // RUN: -gdwarf-5 -gpubnames -gsplit-dwarf -O3 -c -o %t1.o
14
15 // RUN: llvm-dwarfdump %t1.o | FileCheck %s --check-prefix DWARFDUMP_O
16 // RUN: llvm-dwarfdump %t1.dwo | FileCheck %s --check-prefix DWARFDUMP_DWO
17 // RUN: %lldb -b -o 'script lldb.SBDebugger.Create().CreateTarget("%t1.o").FindFunctions("main",lldb.eFunctionNameTypeAuto).GetContextAtIndex(0).GetFunction().GetIsOptimized()' | FileCheck %s
18
19 // DWARFDUMP_O-NOT: DW_AT_APPLE_optimized
20 //
21 // DWARFDUMP_DWO: DW_TAG_compile_unit
22 // DWARFDUMP_DWO-NOT: DW_TAG_
23 // DWARFDUMP_DWO: DW_AT_APPLE_optimized (true)
24
25 // CHECK: (lldb) script lldb.SBDebugger.Create()
26 // CHECK-NEXT: True
27
main(void)28 int main(void) { return 0; }
29