1# REQUIRES: lld 2 3# Make sure DWARF v4 type units work. 4# RUN: %clangxx -target x86_64-pc-linux %S/Inputs/debug-types-basic.cpp \ 5# RUN: -g -gdwarf-4 -fdebug-types-section -c -o %t4.o 6# RUN: ld.lld %t4.o -o %t4 7# RUN: %lldb %t4 -s %s -o exit | FileCheck %s 8 9# Now do the same for DWARF v5. 10# RUN: %clangxx -target x86_64-pc-linux %S/Inputs/debug-types-basic.cpp \ 11# RUN: -g -gdwarf-5 -fdebug-types-section -c -o %t5.o 12# RUN: ld.lld %t5.o -o %t5 13# RUN: %lldb %t5 -s %s -o exit | FileCheck %s 14 15# Test type units in dwo files. 16# RUN: %clangxx -target x86_64-pc-linux %S/Inputs/debug-types-basic.cpp \ 17# RUN: -g -gdwarf-4 -fdebug-types-section -gsplit-dwarf -c -o %t4dwo.o 18# RUN: ld.lld %t4dwo.o -o %t4dwo 19# RUN: %lldb %t4dwo -s %s -o exit | FileCheck %s 20 21# And type units+dwo+dwarf5. 22# RUN: %clangxx -target x86_64-pc-linux %S/Inputs/debug-types-basic.cpp \ 23# RUN: -g -gdwarf-5 -fdebug-types-section -gsplit-dwarf -c -o %t5dwo.o 24# RUN: ld.lld %t5dwo.o -o %t5dwo 25# RUN: %lldb %t5dwo -s %s -o exit | FileCheck %s 26 27type lookup A 28# CHECK-LABEL: type lookup A 29# CHECK: struct A { 30# CHECK-NEXT: int i; 31# CHECK-NEXT: long l; 32# CHECK-NEXT: float f; 33# CHECK-NEXT: double d; 34# CHECK-NEXT: E e; 35# CHECK-NEXT: EC ec; 36# CHECK-NEXT: } 37 38type lookup E 39# CHECK-LABEL: type lookup E 40# CHECK: enum E { 41# CHECK-NEXT: e1, 42# CHECK-NEXT: e2, 43# CHECK-NEXT: e3 44# CHECK-NEXT: } 45 46type lookup EC 47# CHECK-LABEL: type lookup EC 48# CHECK: enum class EC { 49# CHECK-NEXT: e1, 50# CHECK-NEXT: e2, 51# CHECK-NEXT: e3 52# CHECK-NEXT: } 53 54print (E) 1 55# CHECK-LABEL: print (E) 1 56# CHECK: (E) $0 = e2 57 58print (EC) 1 59# CHECK-LABEL: print (EC) 1 60# CHECK: (EC) $1 = e2 61 62target variable a e ec 63# CHECK-LABEL: target variable a e ec 64# CHECK: (const A) a = (i = 42, l = 47, f = 4.{{[12].*}}, d = 4.{{[67].*}}, e = e1, ec = e3) 65# CHECK: (const E) e = e2 66# CHECK: (const EC) ec = e2 67