Skip to content

Commit

Permalink
Merge pull request #69 from lazka/test-gcc-crashes
Browse files Browse the repository at this point in the history
Add some tests for the recent gcc crashes
  • Loading branch information
lazka committed May 13, 2024
2 parents 223e4d0 + c49890b commit 3b42587
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 0 deletions.
10 changes: 10 additions & 0 deletions toolchain/meson/tests/ices/gcc-115038-1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115038#c0
// gcc -c -fno-omit-frame-pointer -O2 repro.cpp
template <typename a> void b(a, a);
template <typename a> void c(a, a, float);
float d;
void e() {
float f;
c(f, f, d);
b(0.0f, f);
}
21 changes: 21 additions & 0 deletions toolchain/meson/tests/ices/gcc-115038-2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115038#c1
// gcc -c -fno-omit-frame-pointer -O2 repro.cpp
struct d {
d();
};
struct e {
e() : c(1.0) {}
float c;
};
struct j {
using ad = d;
};
class k : j {
d g;
e h;
};
template <typename, typename, typename, typename> using i = k;
class {
i<int, int, int, int> f;
} a;
k b;
6 changes: 6 additions & 0 deletions toolchain/meson/tests/ices/gcc-115038-3.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115038#c5
// gcc -c -O2 repro.c -> internal compiler error: in seh_cfa_offset
// gcc -c -g3 -O2 -gdwarf-2 repro.c -> internal compiler error: in
void a() {
__builtin_unwind_init();
}
20 changes: 20 additions & 0 deletions toolchain/meson/tests/ices/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
c_compiler_program = find_program(meson.get_compiler('c').cmd_array().get(-1))
cpp_compiler_program = find_program(meson.get_compiler('cpp').cmd_array().get(-1))

test('ice-gcc-115038-1',
cpp_compiler_program, args: [
'-c', '-O2', '-fno-omit-frame-pointer',
meson.current_source_dir() / 'gcc-115038-1.cpp'
])

test('ice-gcc-115038-2',
cpp_compiler_program, args: [
'-c', '-O2', '-fno-omit-frame-pointer',
meson.current_source_dir() / 'gcc-115038-2.cpp'
])

test('ice-gcc-115038-3',
c_compiler_program, args: [
'-c', '-O2',
meson.current_source_dir() / 'gcc-115038-3.c'
])
1 change: 1 addition & 0 deletions toolchain/meson/tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ if compiler.get_id() == 'clang' and compiler.get_linker_id() == 'ld.lld'
endif

subdir('def-undec-stdcall')
subdir('ices')

0 comments on commit 3b42587

Please sign in to comment.