50 lines · plain
1; Test finding types by CompilerContext.2; RUN: llc %s -filetype=obj -o %t.o3; RUN: lldb-test symbols %t.o -find=type --language=C99 \4; RUN: -compiler-context="Module:CModule,Module:SubModule,ClassOrStruct:FromSubmoduleX" \5; RUN: | FileCheck %s --check-prefix=NORESULTS6; RUN: lldb-test symbols %t.o -find=type --language=C++ \7; RUN: -compiler-context="Module:CModule,Module:SubModule,ClassOrStruct:FromSubmodule" \8; RUN: | FileCheck %s --check-prefix=NORESULTS9; RUN: lldb-test symbols %t.o -find=type --language=C99 \10; RUN: -compiler-context="Module:CModule,Module:SubModule,ClassOrStruct:FromSubmodule" \11; RUN: | FileCheck %s12; RUN: lldb-test symbols %t.o -find=type -find-in-any-module --language=C99 \13; RUN: -compiler-context="ClassOrStruct:FromSubmodule" \14; RUN: | FileCheck %s15; RUN: lldb-test symbols %t.o -find=type --language=C99 \16; RUN: -compiler-context="Module:CModule,Module:SubModule,AnyType:FromSubmodule" \17; RUN: | FileCheck %s18;19; NORESULTS: Found 0 types20; CHECK: Found 1 types:21; CHECK: struct FromSubmodule {22; CHECK-NEXT: unsigned int x;23; CHECK-NEXT: unsigned int y;24; CHECK-NEXT: unsigned int z;25; CHECK-NEXT: }26 27source_filename = "/t.c"28target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"29target triple = "x86_64-apple-macosx10.14.0"30 31!llvm.dbg.cu = !{!2}32!llvm.linker.options = !{}33!llvm.module.flags = !{!18, !19}34!llvm.ident = !{!22}35 36; This simulates the debug info for a Clang module.37!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, nameTableKind: GNU, retainedTypes: !{!11}, sysroot: "/")38!3 = !DIFile(filename: "t.c", directory: "/")39!8 = !DIModule(scope: !9, name: "SubModule", includePath: "")40!9 = !DIModule(scope: null, name: "CModule", includePath: "")41!11 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "FromSubmodule", scope: !8, file: !3, line: 1, size: 96, elements: !13)42!13 = !{!14, !16, !17}43!14 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !11, file: !3, line: 2, baseType: !15, size: 32)44!15 = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned)45!16 = !DIDerivedType(tag: DW_TAG_member, name: "y", scope: !11, file: !3, line: 2, baseType: !15, size: 32, offset: 32)46!17 = !DIDerivedType(tag: DW_TAG_member, name: "z", scope: !11, file: !3, line: 2, baseType: !15, size: 32, offset: 64)47!18 = !{i32 2, !"Dwarf Version", i32 4}48!19 = !{i32 2, !"Debug Info Version", i32 3}49!22 = !{!"clang version 10.0.0 (https://github.com/llvm/llvm-project 056f1b5cc7c2133f0cb3e30e7f24808d321096d7)"}50