@@ -7286,7 +7286,7 @@ def test_disable_inlining(self):
7286
7286
create_file ('test.c' , r'''
7287
7287
#include <stdio.h>
7288
7288
7289
- void foo() {
7289
+ static void foo() {
7290
7290
printf("foo\n");
7291
7291
}
7292
7292
@@ -7296,17 +7296,11 @@ def test_disable_inlining(self):
7296
7296
}
7297
7297
''' )
7298
7298
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' ]
7301
7302
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
7310
7304
self .assertContained ('foo' , output )
7311
7305
7312
7306
def test_output_eol (self ):
0 commit comments