Skip to content

Commit 3e5a57a

Browse files
committed
revert test changes
1 parent f20fd5e commit 3e5a57a

File tree

3 files changed

+20
-22
lines changed

3 files changed

+20
-22
lines changed
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
#include <emscripten.h>
22

3-
namespace NameSpace {
43
EM_JS(int, out_to_js, (int x), {})
54

65
void __attribute__((noinline)) foo() {
7-
out_to_js(0); // line 7
6+
out_to_js(0); // line 6
87
out_to_js(1);
98
out_to_js(2);
109
}
1110

1211
void __attribute__((always_inline)) bar() {
1312
out_to_js(3);
14-
__builtin_trap(); // line 14
13+
__builtin_trap(); // line 13
1514
}
16-
};
1715

1816
int main() {
19-
NameSpace::foo();
20-
NameSpace::bar();
17+
foo();
18+
bar();
2119
}

test/test_core.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7891,9 +7891,9 @@ def test_embind_dylink_visibility_hidden(self):
78917891
def test_dwarf(self):
78927892
self.cflags.append('-g')
78937893

7894-
shutil.copy(test_file('core/test_dwarf.cpp'), '.')
7894+
shutil.copy(test_file('core/test_dwarf.c'), '.')
78957895

7896-
self.emcc('test_dwarf.cpp')
7896+
self.emcc('test_dwarf.c')
78977897

78987898
out = self.run_process([shared.LLVM_DWARFDUMP, 'a.out.wasm', '-all'], stdout=PIPE).stdout
78997899

@@ -7926,15 +7926,15 @@ def add_section():
79267926
self.assertIn('.debug_ranges', sections)
79277927

79287928
# verify some content in the sections
7929-
self.assertIn('"test_dwarf.cpp"', sections['.debug_info'])
7929+
self.assertIn('"test_dwarf.c"', sections['.debug_info'])
79307930
# the line section looks like this:
79317931
# Address Line Column File ISA Discriminator Flags
79327932
# ------------------ ------ ------ ------ --- ------------- -------------
79337933
# 0x000000000000000b 5 0 3 0 0 is_stmt
79347934
src_to_addr = {}
79357935
found_dwarf_c = False
79367936
for line in sections['.debug_line'].splitlines():
7937-
if 'name: "test_dwarf.cpp"' in line:
7937+
if 'name: "test_dwarf.c"' in line:
79387938
found_dwarf_c = True
79397939
if not found_dwarf_c:
79407940
continue

test/test_other.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10924,10 +10924,10 @@ def check_source_map_loc_info(address, loc):
1092410924
stdout=PIPE).stdout
1092510925
self.assertIn(loc, out)
1092610926

10927-
# We test two locations within test_dwarf.cpp:
10928-
# out_to_js(0); // line 7
10929-
# __builtin_trap(); // line 14
10930-
self.run_process([EMCC, test_file('core/test_dwarf.cpp'),
10927+
# We test two locations within test_dwarf.c:
10928+
# out_to_js(0); // line 6
10929+
# __builtin_trap(); // line 13
10930+
self.run_process([EMCC, test_file('core/test_dwarf.c'),
1093110931
'-g', '-gsource-map', '-O1', '-o', 'test_dwarf.js'])
1093210932
# Address of out_to_js(0) within foo(), uninlined
1093310933
out_to_js_call_addr = self.get_instr_addr('call\t0', 'test_dwarf.wasm')
@@ -10941,10 +10941,10 @@ def check_source_map_loc_info(address, loc):
1094110941
unreachable_func = ['bar', 'main']
1094210942

1094310943
# Source location of out_to_js(0) within foo(), uninlined
10944-
out_to_js_call_loc = ['test_dwarf.cpp:7:3']
10944+
out_to_js_call_loc = ['test_dwarf.c:6:3']
1094510945
# Source locations of __builtin_trap() within bar(), inlined into main().
1094610946
# The first one corresponds to the innermost inlined location.
10947-
unreachable_loc = ['test_dwarf.cpp:14:3', 'test_dwarf.cpp:20:3']
10947+
unreachable_loc = ['test_dwarf.c:13:3', 'test_dwarf.c:18:3']
1094810948

1094910949
# 1. Test DWARF + source map together
1095010950
# For DWARF, we check for the full inlined info for both function names and
@@ -10960,13 +10960,13 @@ def check_source_map_loc_info(address, loc):
1096010960
# The addresses, function names, and source locations are the same across
1096110961
# the builds because they are relative offsets from the code section, so we
1096210962
# don't need to recompute them
10963-
self.run_process([EMCC, test_file('core/test_dwarf.cpp'),
10963+
self.run_process([EMCC, test_file('core/test_dwarf.c'),
1096410964
'-gsource-map', '-O1', '-o', 'test_dwarf.js'])
1096510965
check_source_map_loc_info(out_to_js_call_addr, out_to_js_call_loc[0])
1096610966
check_source_map_loc_info(unreachable_addr, unreachable_loc[0])
1096710967

1096810968
# 3. Test DWARF only
10969-
self.run_process([EMCC, test_file('core/test_dwarf.cpp'),
10969+
self.run_process([EMCC, test_file('core/test_dwarf.c'),
1097010970
'-g', '-O1', '-o', 'test_dwarf.js'])
1097110971
check_dwarf_loc_info(out_to_js_call_addr, out_to_js_call_func,
1097210972
out_to_js_call_loc)
@@ -10980,7 +10980,7 @@ def check_func_info(filename, address, func):
1098010980
self.assertIn(func, out)
1098110981

1098210982
# 1. Test name section only
10983-
self.run_process([EMCC, test_file('core/test_dwarf.cpp'),
10983+
self.run_process([EMCC, test_file('core/test_dwarf.c'),
1098410984
'--profiling-funcs', '-O1', '-o', 'test_dwarf.js'])
1098510985
with webassembly.Module('test_dwarf.wasm') as wasm:
1098610986
self.assertTrue(wasm.has_name_section())
@@ -10989,12 +10989,12 @@ def check_func_info(filename, address, func):
1098910989
out_to_js_call_addr = self.get_instr_addr('call\t0', 'test_dwarf.wasm')
1099010990
# Address of __builtin_trap() within bar(), inlined into main()
1099110991
unreachable_addr = self.get_instr_addr('unreachable', 'test_dwarf.wasm')
10992-
check_func_info('test_dwarf.wasm', out_to_js_call_addr, 'foo()')
10992+
check_func_info('test_dwarf.wasm', out_to_js_call_addr, 'foo')
1099310993
# The name section will not show bar, as it's inlined into main
1099410994
check_func_info('test_dwarf.wasm', unreachable_addr, '__original_main')
1099510995

1099610996
# 2. Test symbol map
10997-
self.run_process([EMCC, test_file('core/test_dwarf.cpp'),
10997+
self.run_process([EMCC, test_file('core/test_dwarf.c'),
1099810998
'-O1', '--emit-symbol-map', '-o', 'test_dwarf.js'])
1099910999
self.assertExists('test_dwarf.js.symbols')
1100011000

@@ -11007,7 +11007,7 @@ def check_symbolmap_info(address, func):
1100711007
out_to_js_call_addr = self.get_instr_addr('call\t0', 'test_dwarf.wasm')
1100811008
# Address of __builtin_trap() within bar(), inlined into main()
1100911009
unreachable_addr = self.get_instr_addr('unreachable', 'test_dwarf.wasm')
11010-
check_symbolmap_info(out_to_js_call_addr, 'foo()')
11010+
check_symbolmap_info(out_to_js_call_addr, 'foo')
1101111011
# The name section will not show bar, as it's inlined into main
1101211012
check_symbolmap_info(unreachable_addr, '__original_main')
1101311013

0 commit comments

Comments
 (0)