Francis Ricci | fe6cbce | 2018-03-02 22:56:45 +0000 | [diff] [blame] | 1 | #Source: |
| 2 | ##include <stdio.h> |
| 3 | #static inline int inctwo (int *a) { |
| 4 | # printf ("%d\n",(*a)++); |
| 5 | # return (*a)++; |
| 6 | #} |
| 7 | #static inline int inc (int *a) { |
| 8 | # printf ("%d\n",inctwo(a)); |
| 9 | # return (*a)++; |
| 10 | #} |
| 11 | # |
| 12 | # |
| 13 | #int main () { |
| 14 | # int x = 1; |
| 15 | # return inc(&x); |
| 16 | #} |
| 17 | # |
| 18 | #Build as : clang -g -O2 addr.c |
| 19 | |
| 20 | RUN: mkdir -p %t/.debug |
Jordan Rupprecht | c5bae78 | 2018-11-13 19:32:27 +0000 | [diff] [blame] | 21 | RUN: llvm-objcopy --keep-section=.debug_info %p/Inputs/addr.exe %t/.debug/addr |
Francis Ricci | fe6cbce | 2018-03-02 22:56:45 +0000 | [diff] [blame] | 22 | RUN: llvm-objcopy --strip-debug --add-gnu-debuglink=%t/.debug/addr %p/Inputs/addr.exe %t/addr.exe |
David Blaikie | 79c3d8b | 2019-01-24 01:19:17 +0000 | [diff] [blame] | 23 | RUN: llvm-symbolizer -print-address -obj=%t/addr.exe 0x40054d | FileCheck %s |
Francis Ricci | fe6cbce | 2018-03-02 22:56:45 +0000 | [diff] [blame] | 24 | |
| 25 | #CHECK: 0x40054d |
| 26 | #CHECK: {{[/\]+}}tmp{{[/\]+}}x.c:14:0 |