Skip to content

Commit 00a2cec

Browse files
committed
goto-gcc: run original compiler even when output is /dev/null
1 parent d20a12e commit 00a2cec

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

regression/goto-gcc/dev_null1/main.c

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
void gcc_fails(void)
2+
{
3+
asm volatile ( ".if ((1 > 0) < 0); .error \"this is gcc\";.endif" );
4+
}
5+
6+
void clang_fails(void)
7+
{
8+
asm volatile ( ".if ((1 > 0) > 0); .error \"this is clang\";.endif" );
9+
}
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.c
3+
-o /dev/null
4+
^EXIT=1$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring
8+
^CONVERSION ERROR$

src/goto-cc/gcc_mode.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ int gcc_modet::gcc_hybrid_binary(compilet &compiler)
914914
if(output_files.empty() ||
915915
(output_files.size()==1 &&
916916
output_files.front()=="/dev/null"))
917-
return EX_OK;
917+
return run_gcc(compiler);
918918

919919
debug() << "Running " << native_tool_name
920920
<< " to generate hybrid binary" << eom;

0 commit comments

Comments
 (0)