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