Skip to content

Commit 80b6f7b

Browse files
committed
Example cases for pahole
Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 0d3ed2c commit 80b6f7b

File tree

7 files changed

+21
-0
lines changed

7 files changed

+21
-0
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
all:
2+
rustc --crate-type=lib --emit=obj -g inverted.rs
3+
rustc --crate-type=lib --emit=obj -g namespace.rs
4+

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Example Rust cases for `pahole`
2+

core.o

2.58 MB
Binary file not shown.

inverted.o

3.91 KB
Binary file not shown.

inverted.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
pub struct S {
2+
a: bool,
3+
b: u32,
4+
}
5+
6+
pub fn f(mut s: S) -> S {
7+
s.a = !s.a;
8+
s.b += 42;
9+
s
10+
}

namespace.o

2.71 KB
Binary file not shown.

namespace.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pub struct S {
2+
pub a: i32,
3+
}
4+
5+
pub static S: (i32, S) = (42, S { a: 42 });

0 commit comments

Comments
 (0)