James Henderson 1364750dad [RFC][debuginfo-test] Rename debug-info lit tests for general purposes
Discussion thread:
https://lists.llvm.org/pipermail/llvm-dev/2021-January/148048.html

Move debuginfo-test into a subdirectory of a new top-level directory,
called cross-project-tests. The new name replaces "debuginfo-test" as an
LLVM project enabled via LLVM_ENABLE_PROJECTS.

Differential Revision: https://reviews.llvm.org/D95339

Reviewed by: aprantl
2021-06-28 11:31:40 +01:00

34 lines
1.0 KiB
C

// XFAIL:*
//// Currently, LowerDbgDeclare doesn't lower dbg.declares pointing at allocas
//// for structs.
// REQUIRES: lldb
// UNSUPPORTED: system-windows
// RUN: %dexter --fail-lt 1.0 -w --debugger lldb \
// RUN: --builder clang-c --cflags "-O2 -glldb" -- %s
//
//// Check debug-info for the escaped struct variable num is reasonable.
#include <stdio.h>
struct Nums { int a, b, c; };
struct Nums glob;
__attribute__((__noinline__))
void esc(struct Nums* nums) {
glob = *nums;
}
__attribute__((__noinline__))
int main() {
struct Nums nums = { .c=1 }; //// Dead store.
printf("s1 nums.c: %d\n", nums.c); // DexLabel('s1')
nums.c = 2; //// Killing store.
printf("s2 nums.c: %d\n", nums.c); // DexLabel('s2')
esc(&nums); //// Force nums to live on the stack.
return 0; // DexLabel('s3')
}
// DexExpectWatchValue('nums.c', '1', on_line=ref('s1'))
// DexExpectWatchValue('nums.c', '2', from_line=ref('s2'), to_line=ref('s3'))