@@ -7286,7 +7286,7 @@ def test_disable_inlining(self):
72867286 create_file ('test.c' , r'''
72877287#include <stdio.h>
72887288
7289- void foo() {
7289+ static void foo() {
72907290 printf("foo\n");
72917291}
72927292
@@ -7296,17 +7296,11 @@ def test_disable_inlining(self):
72967296}
72977297''' )
72987298
7299- # Without the 'INLINING_LIMIT', -O2 inlines foo()
7300- cmd = [EMCC , '-c' , 'test.c' , '-O2' , '-o' , 'test.o' , '-sINLINING_LIMIT' , '-flto' ]
7299+ # Without the 'INLINING_LIMIT', -O2 inlines foo() and then DCEs it because it has
7300+ # no callers and is static
7301+ cmd = [EMCC , 'test.c' , '-O2' , '-o' , 'test.o' , '-c' , '-sINLINING_LIMIT' ]
73017302 self .run_process (cmd )
7302- # If foo() had been wrongly inlined above, internalizing foo and running
7303- # global DCE makes foo DCE'd
7304- opts = ['-internalize' , '-internalize-public-api-list=main' , '-globaldce' ]
7305- self .run_process ([shared .LLVM_OPT ] + opts + ['test.o' , '-o' , 'test2.o' ])
7306-
7307- # To this test to be successful, foo() shouldn't have been inlined above and
7308- # foo() should be in the function list
7309- output = self .run_process ([shared .EM_NM , 'test2.o' ], stdout = PIPE ).stdout
7303+ output = self .run_process ([common .LLVM_OBJDUMP , '-t' , 'test.o' ], stdout = PIPE ).stdout
73107304 self .assertContained ('foo' , output )
73117305
73127306 def test_output_eol (self ):
0 commit comments