dwarf: files compiled with both -g1 and -g2 (#18)

This commit is contained in:
Philip Craig
2024-10-03 15:24:39 +10:00
committed by GitHub
parent c51252fb9b
commit 5c597e6e55
6 changed files with 35 additions and 0 deletions
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+30
View File
@@ -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;
}
+5
View File
@@ -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