Hemant Kulkarni | 80f82fb | 2015-10-12 19:26:44 +0000 | [diff] [blame] | 1 | #Source: |
| 2 | ##include <stdio.h> |
Hemant Kulkarni | bdce12a | 2015-11-11 20:41:43 +0000 | [diff] [blame] | 3 | #static inline int inctwo (int *a) { |
Hemant Kulkarni | 80f82fb | 2015-10-12 19:26:44 +0000 | [diff] [blame] | 4 | # printf ("%d\n",(*a)++); |
| 5 | # return (*a)++; |
| 6 | #} |
Hemant Kulkarni | bdce12a | 2015-11-11 20:41:43 +0000 | [diff] [blame] | 7 | #static inline int inc (int *a) { |
| 8 | # printf ("%d\n",inctwo(a)); |
| 9 | # return (*a)++; |
| 10 | #} |
| 11 | # |
Hemant Kulkarni | 80f82fb | 2015-10-12 19:26:44 +0000 | [diff] [blame] | 12 | # |
| 13 | #int main () { |
| 14 | # int x = 1; |
| 15 | # return inc(&x); |
| 16 | #} |
Hemant Kulkarni | bdce12a | 2015-11-11 20:41:43 +0000 | [diff] [blame] | 17 | # |
Hemant Kulkarni | 80f82fb | 2015-10-12 19:26:44 +0000 | [diff] [blame] | 18 | #Build as : clang -g -O2 addr.c |
| 19 | |
Hemant Kulkarni | bdce12a | 2015-11-11 20:41:43 +0000 | [diff] [blame] | 20 | RUN: llvm-symbolizer -print-address -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck %s |
| 21 | RUN: llvm-symbolizer -inlining -print-address -pretty-print -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck --check-prefix="PRETTY" %s |
Hemant Kulkarni | 80f82fb | 2015-10-12 19:26:44 +0000 | [diff] [blame] | 22 | |
Mike Aizatsky | 54a7c69 | 2016-01-07 23:57:41 +0000 | [diff] [blame] | 23 | #CHECK: some text |
Hemant Kulkarni | 80f82fb | 2015-10-12 19:26:44 +0000 | [diff] [blame] | 24 | #CHECK: 0x40054d |
| 25 | #CHECK: main |
Hemant Kulkarni | bdce12a | 2015-11-11 20:41:43 +0000 | [diff] [blame] | 26 | #CHECK: {{[/\]+}}tmp{{[/\]+}}x.c:14:0 |
Mike Aizatsky | 54a7c69 | 2016-01-07 23:57:41 +0000 | [diff] [blame] | 27 | #CHECK: some text2 |
Hemant Kulkarni | bdce12a | 2015-11-11 20:41:43 +0000 | [diff] [blame] | 28 | # |
Mike Aizatsky | 54a7c69 | 2016-01-07 23:57:41 +0000 | [diff] [blame] | 29 | #PRETTY: some text |
Hemant Kulkarni | bdce12a | 2015-11-11 20:41:43 +0000 | [diff] [blame] | 30 | #PRETTY: {{[0x]+}}40054d: inctwo at {{[/\]+}}tmp{{[/\]+}}x.c:3:3 |
| 31 | #PRETTY: (inlined by) inc at {{[/\]+}}tmp{{[/\]+}}x.c:7:0 |
| 32 | #PRETTY (inlined by) main at {{[/\]+}}tmp{{[/\]+}}x.c:14:0 |
Mike Aizatsky | 54a7c69 | 2016-01-07 23:57:41 +0000 | [diff] [blame] | 33 | #PRETTY: some text2 |
Hemant Kulkarni | 80f82fb | 2015-10-12 19:26:44 +0000 | [diff] [blame] | 34 | |