Skip to content

Commit 9896259

Browse files
committed
Add new test in test_other.py: test_source_file_with_fixed_language_mode
1 parent de44af5 commit 9896259

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

tests/test_other.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2059,7 +2059,7 @@ def test_llvm_nativizer(self):
20592059
output = Popen([os.path.join(self.get_dir(), 'files.o.run')], stdin=open(os.path.join(self.get_dir(), 'stdin')), stdout=PIPE, stderr=PIPE).communicate()
20602060
self.assertContained('''size: 37
20612061
data: 119,97,107,97,32,119,97,107,97,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35
2062-
loop: 119 97 107 97 32 119 97 107 97 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35
2062+
loop: 119 97 107 97 32 119 97 107 97 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35
20632063
input:inter-active
20642064
texto
20652065
$
@@ -6365,3 +6365,16 @@ def test_cyberdwarf_union(self):
63656365
check_execute([PYTHON, EMCC, path_from_root('tests', 'debugger', 'test_union.cpp'), '-Oz', '-s', 'CYBERDWARF=1',
63666366
'-std=c++11', '--pre-js', path_from_root('tests', 'debugger', 'test_preamble.js'), '-o', 'test_union.js' ], stderr=PIPE)
63676367
run_js('test_union.js', engine=NODE_JS)
6368+
6369+
def test_source_file_with_fixed_language_mode(self):
6370+
open('src_tmp_fixed_lang', 'w').write('''
6371+
#include <cstdint>
6372+
#include <cstddef>
6373+
6374+
int main() {
6375+
return 0;
6376+
}
6377+
''')
6378+
stdout, stderr = Popen([PYTHON, EMCC, '-Wall', '-std=c++14', '-x', 'c++', 'src_tmp_fixed_lang'], stderr=PIPE).communicate()
6379+
self.assertNotContained("Input file has an unknown suffix, don't know what to do with it!", stderr)
6380+
self.assertNotContained("Unknown file suffix when compiling to LLVM bitcode", stderr)

0 commit comments

Comments
 (0)