2018-03-03 06:56:45 +08:00
|
|
|
#Source:
|
|
|
|
##include <stdio.h>
|
|
|
|
#static inline int inctwo (int *a) {
|
|
|
|
# printf ("%d\n",(*a)++);
|
|
|
|
# return (*a)++;
|
|
|
|
#}
|
|
|
|
#static inline int inc (int *a) {
|
|
|
|
# printf ("%d\n",inctwo(a));
|
|
|
|
# return (*a)++;
|
|
|
|
#}
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#int main () {
|
|
|
|
# int x = 1;
|
|
|
|
# return inc(&x);
|
|
|
|
#}
|
|
|
|
#
|
|
|
|
#Build as : clang -g -O2 addr.c
|
|
|
|
|
|
|
|
RUN: mkdir -p %t/.debug
|
[llvm-objcopy] Rename --keep to --keep-section.
Summary:
llvm-objcopy/strip support `--keep` (for sections) and `--keep-symbols` (for symbols). For consistency and clarity, rename `--keep` to `--keep-section`.
In fact, for GNU compatability, -K is --keep-symbol, so it's weird that the alias `-K` is not the same as the short-ish `--keep`.
Reviewers: jakehehrlich, jhenderson, alexshap, MaskRay, espindola
Reviewed By: jakehehrlich, MaskRay
Subscribers: emaste, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D54477
llvm-svn: 346782
2018-11-14 03:32:27 +08:00
|
|
|
RUN: llvm-objcopy --keep-section=.debug_info %p/Inputs/addr.exe %t/.debug/addr
|
2018-03-03 06:56:45 +08:00
|
|
|
RUN: llvm-objcopy --strip-debug --add-gnu-debuglink=%t/.debug/addr %p/Inputs/addr.exe %t/addr.exe
|
2019-01-24 09:19:17 +08:00
|
|
|
RUN: llvm-symbolizer -print-address -obj=%t/addr.exe 0x40054d | FileCheck %s
|
2018-03-03 06:56:45 +08:00
|
|
|
|
|
|
|
#CHECK: 0x40054d
|
|
|
|
#CHECK: {{[/\]+}}tmp{{[/\]+}}x.c:14:0
|