diff --git a/dwarf/base-clang-g1 b/dwarf/base-clang-g1 new file mode 100755 index 0000000..230328f Binary files /dev/null and b/dwarf/base-clang-g1 differ diff --git a/dwarf/base-clang-g2 b/dwarf/base-clang-g2 new file mode 100755 index 0000000..426a8cc Binary files /dev/null and b/dwarf/base-clang-g2 differ diff --git a/dwarf/base-gcc-g1 b/dwarf/base-gcc-g1 new file mode 100755 index 0000000..d28c0c0 Binary files /dev/null and b/dwarf/base-gcc-g1 differ diff --git a/dwarf/base-gcc-g2 b/dwarf/base-gcc-g2 new file mode 100755 index 0000000..3cb7645 Binary files /dev/null and b/dwarf/base-gcc-g2 differ diff --git a/dwarf/base.cpp b/dwarf/base.cpp new file mode 100644 index 0000000..409aa32 --- /dev/null +++ b/dwarf/base.cpp @@ -0,0 +1,30 @@ +#define SIZE 10000 + +const char *sarr[SIZE]; + +struct Foo +{ + int a; + void foo(int path); + void bar(const char *s); +}; + +void Foo::bar(const char *s) { + int i; + for (i = 0; i < SIZE; i++) + sarr[i] = s; +} + +__attribute__((noinline)) +void Foo::foo(int path) { + if (path) + bar("hello"); + else + bar("world"); +} + +int main(int argc, char *argv[]) { + Foo foo = {}; + foo.foo(argc); + return 0; +} diff --git a/dwarf/base.sh b/dwarf/base.sh new file mode 100644 index 0000000..8f895a0 --- /dev/null +++ b/dwarf/base.sh @@ -0,0 +1,5 @@ +CFLAGS="-fdebug-prefix-map=`pwd`=/object/testfiles/dwarf -O3" +g++-13 $CFLAGS base.cpp -o base-gcc-g1 -g1 +g++-13 $CFLAGS base.cpp -o base-gcc-g2 -g2 +clang++-18 $CFLAGS base.cpp -o base-clang-g1 -g1 +clang++-18 $CFLAGS base.cpp -o base-clang-g2 -g2