1 // Test that optimized flag is properly included in DWARF.
2 
3 // ObjectFileELF::ApplyRelocations does not implement arm32.
4 // XFAIL: target-arm && linux-gnu
5 
6 // RUN: %clang_host %s -fno-standalone-debug -glldb \
7 // RUN:   -gdwarf-5 -gpubnames -gsplit-dwarf -O3 -c -o %t1.o
8 
9 // RUN: llvm-dwarfdump %t1.o | FileCheck %s --check-prefix DWARFDUMP_O
10 // RUN: llvm-dwarfdump %t1.dwo | FileCheck %s --check-prefix DWARFDUMP_DWO
11 // RUN: %lldb -b -o 'script lldb.SBDebugger.Create().CreateTarget("%t1.o").FindFunctions("main",lldb.eFunctionNameTypeAuto).GetContextAtIndex(0).GetFunction().GetIsOptimized()' | FileCheck %s
12 
13 // DWARFDUMP_O-NOT: DW_AT_APPLE_optimized
14 //
15 // DWARFDUMP_DWO: DW_TAG_compile_unit
16 // DWARFDUMP_DWO-NOT: DW_TAG_
17 // DWARFDUMP_DWO: DW_AT_APPLE_optimized	(true)
18 
19 // CHECK: (lldb) script lldb.SBDebugger.Create()
20 // CHECK-NEXT: True
21 
22 int main(void) { return 0; }
23