Files
clang-p2996/lldb/test/API/functionalities/unused-inlined-parameters/main.c
Michael Buch 9427487fdb [lldb][Test] Prevent generating DW_AT_location for unused argument
This test simply checks whether we can print an optimized
function argument. With recent changes to Clang the assumption
that we don't generate a `DW_AT_location` attribute for the
unused funciton parameter breaks.

This patch tries harder to get Clang to drop the location
from DWARF by making it generate an `undef` for `unused1`.
Drop the check for `unused2` since it adds no benefit.

Differential Revision: https://reviews.llvm.org/D132635
2022-08-25 08:49:13 +01:00

14 lines
275 B
C

#include <stdio.h>
__attribute__((optnone)) __attribute__((nodebug)) void use(int used) {}
__attribute__((always_inline)) void f(void *unused1, int used) {
use(used); // break here
}
int main(int argc, char **argv) {
char *undefined;
f(undefined, 42);
return 0;
}