brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · feb42c2 Raw
62 lines · plain
1;; This test checks whether DWARF operator DW_OP_push_object_address2;; is accepted and processed.3; REQUIRES: x86_64-linux4 5; RUN: llc -mtriple=x86_64-unknown-linux-gnu %s -filetype=obj -o - | llvm-dwarfdump - | FileCheck %s6 7;; Test whether DW_OP_push_object_address is accepted.8 9; CHECK-LABEL:       DW_TAG_variable10; CHECK:        DW_AT_location11; CHECK-SAME:        DW_OP_push_object_address12 13;; Below is the original test case this IR is generated from14;;---------------------------15;;int main() {16;;int var;17;;return var;18;;}19;;---------------------------20;; step 1: generate IR using -g -O0 -S -emit-llvm21;; step 2: insert DW_OP_push_object_address in dbg.declare instruction22;; This is meaningless test case focused to test DW_OP_push_object_address.23 24; ModuleID = 'dwarfdump-pushobjectaddress.c'25source_filename = "dwarfdump-pushobjectaddress.c"26target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"27target triple = "x86_64-unknown-linux-gnu"28 29; Function Attrs: noinline nounwind optnone uwtable30define dso_local i32 @main() !dbg !7 {31entry:32  %retval = alloca i32, align 433  %var = alloca i32, align 434  store i32 0, ptr %retval, align 435  call void @llvm.dbg.declare(metadata ptr %var, metadata !11, metadata !DIExpression(DW_OP_push_object_address)), !dbg !1236  %0 = load i32, ptr %var, align 4, !dbg !1337  ret i32 %0, !dbg !1438}39 40; Function Attrs: nounwind readnone speculatable willreturn41declare void @llvm.dbg.declare(metadata, metadata, metadata)42 43!llvm.dbg.cu = !{!0}44!llvm.module.flags = !{!3, !4, !5}45!llvm.ident = !{!6}46 47!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 11.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)48!1 = !DIFile(filename: "dwarfdump-pushobjectaddress.c", directory: "/dir")49!2 = !{}50!3 = !{i32 7, !"Dwarf Version", i32 4}51!4 = !{i32 2, !"Debug Info Version", i32 3}52!5 = !{i32 1, !"wchar_size", i32 4}53!6 = !{!"clang version 11.0.0"}54!7 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type: !8, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)55!8 = !DISubroutineType(types: !9)56!9 = !{!10}57!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)58!11 = !DILocalVariable(name: "var", scope: !7, file: !1, line: 2, type: !10)59!12 = !DILocation(line: 2, column: 5, scope: !7)60!13 = !DILocation(line: 3, column: 8, scope: !7)61!14 = !DILocation(line: 3, column: 1, scope: !7)62