Changeset View
Changeset View
Standalone View
Standalone View
llvm/trunk/test/DebugInfo/X86/dwarf-callsite-related-attrs.ll
; $ clang++ -S -emit-llvm -o - -gdwarf-5 -o - -O1 tail2.cc | ; $ clang++ -S -emit-llvm -o - -gdwarf-5 -o - -O1 tail2.cc | ||||
; volatile int sink; | ; volatile int sink; | ||||
; void __attribute__((noinline)) bat() { sink++; } | ; void __attribute__((noinline)) bat() { sink++; } | ||||
; void __attribute__((noinline)) bar() { sink++; } | ; void __attribute__((noinline)) bar() { sink++; } | ||||
; void __attribute__((noinline)) foo() { | ; void __attribute__((noinline)) foo() { | ||||
; bar(); bat(); | ; bar(); bat(); | ||||
; bar(); bat(); | ; bar(); bat(); | ||||
; } | ; } | ||||
; int __attribute__((disable_tail_calls)) main() { foo(); } | ; int __attribute__((disable_tail_calls)) main() { foo(); } | ||||
; On Windows, we don't handle the relocations needed for AT_return_pc properly | ; On Windows, we don't handle the relocations needed for AT_return_pc properly | ||||
; and fail with "failed to compute relocation: IMAGE_REL_AMD64_ADDR32". | ; and fail with "failed to compute relocation: IMAGE_REL_AMD64_ADDR32". | ||||
; UNSUPPORTED: cygwin,windows-gnu,windows-msvc | ; UNSUPPORTED: cygwin,windows-gnu,windows-msvc | ||||
; REQUIRES: object-emission | ; REQUIRES: object-emission | ||||
; RUN: %llc_dwarf -mtriple=x86_64-- < %s -o - | FileCheck %s -check-prefix=ASM | ; RUN: %llc_dwarf -mtriple=x86_64-- < %s -o - | FileCheck %s -check-prefix=ASM | ||||
; RUN: %llc_dwarf -mtriple=x86_64-- < %s -filetype=obj -o %t.o | ; RUN: %llc_dwarf -debugger-tune=lldb -mtriple=x86_64-- < %s -filetype=obj -o %t.o | ||||
; RUN: llvm-dwarfdump %t.o -o - | FileCheck %s -check-prefix=OBJ -implicit-check-not=DW_TAG_call_site | ; RUN: llvm-dwarfdump %t.o -o - | FileCheck %s -check-prefix=OBJ -implicit-check-not=DW_TAG_call_site | ||||
; RUN: llvm-dwarfdump -verify %t.o 2>&1 | FileCheck %s -check-prefix=VERIFY | ; RUN: llvm-dwarfdump -verify %t.o 2>&1 | FileCheck %s -check-prefix=VERIFY | ||||
; RUN: llvm-dwarfdump -statistics %t.o | FileCheck %s -check-prefix=STATS | ; RUN: llvm-dwarfdump -statistics %t.o | FileCheck %s -check-prefix=STATS | ||||
; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis -o /dev/null | ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis -o /dev/null | ||||
; VERIFY: No errors. | ; VERIFY: No errors. | ||||
; STATS: "call site entries":5 | ; STATS: "call site DIEs":6 | ||||
@sink = global i32 0, align 4, !dbg !0 | @sink = global i32 0, align 4, !dbg !0 | ||||
; ASM: DW_TAG_subprogram | ; ASM: DW_TAG_subprogram | ||||
; ASM: DW_AT_call_all_calls | ; ASM: DW_AT_call_all_calls | ||||
; OBJ: [[bat_sp:.*]]: DW_TAG_subprogram | ; OBJ: [[bat_sp:.*]]: DW_TAG_subprogram | ||||
; OBJ: DW_AT_call_all_calls (true) | ; OBJ: DW_AT_call_all_calls (true) | ||||
; OBJ: DW_AT_name ("bat") | ; OBJ: DW_AT_name ("bat") | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
; ASM: DW_TAG_subprogram | ; ASM: DW_TAG_subprogram | ||||
; ASM: DW_AT_call_all_calls | ; ASM: DW_AT_call_all_calls | ||||
; OBJ: DW_TAG_subprogram | ; OBJ: DW_TAG_subprogram | ||||
; OBJ: DW_AT_call_all_calls (true) | ; OBJ: DW_AT_call_all_calls (true) | ||||
; OBJ: DW_AT_name ("main") | ; OBJ: DW_AT_name ("main") | ||||
; OBJ: DW_TAG_call_site | ; OBJ: DW_TAG_call_site | ||||
; OBJ: DW_AT_call_origin ([[foo_sp]]) | ; OBJ: DW_AT_call_origin ([[foo_sp]]) | ||||
; OBJ: DW_AT_call_return_pc | ; OBJ: DW_AT_call_return_pc | ||||
; OBJ: DW_TAG_call_site | |||||
; OBJ: DW_AT_call_target | |||||
; OBJ: DW_AT_call_return_pc | |||||
define i32 @main() !dbg !29 { | define i32 @main() !dbg !29 { | ||||
entry: | entry: | ||||
call void @_Z3foov(), !dbg !32 | call void @_Z3foov(), !dbg !32 | ||||
%indirect_target = load void ()*, void ()** undef | %indirect_target = load void ()*, void ()** undef | ||||
call void %indirect_target() | call void %indirect_target() | ||||
call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"() | call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"() | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |