Skip to content

Commit

Permalink
Add support for more detailed metadce expectations (#8583)
Browse files Browse the repository at this point in the history
Includes support for automatically updating the expectation files.

Initial this is only for the "sent" functions, but can be extended
to imports and exports later.
  • Loading branch information
sbc100 authored May 10, 2019
1 parent 9d2b6cb commit d449897
Show file tree
Hide file tree
Showing 38 changed files with 3,556 additions and 24 deletions.
13 changes: 13 additions & 0 deletions tests/other/metadce/hello_libcxx.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright 2012 The Emscripten Authors. All rights reserved.
// Emscripten is available under two separate licenses, the MIT license and the
// University of Illinois/NCSA Open Source License. Both these licenses can be
// found in the LICENSE file.

#include <iostream>

int main()
{
std::cout << "hello, world!" << std::endl;
return 0;
}

33 changes: 33 additions & 0 deletions tests/other/metadce/hello_libcxx_O2.sent
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
DYNAMICTOP_PTR
_ZSt18uncaught_exceptionv
__cxa_atexit
__cxa_uncaught_exception
__lock
__map_file
__setErrNo
__syscall140
__syscall145
__syscall146
__syscall54
__syscall6
__syscall91
__unlock
_addDays
_arraySum
_isLeapYear
abort
abortOnCannotGrowMemory
atexit
emscripten_get_heap_size
emscripten_memcpy_big
emscripten_resize_heap
fabs
getenv
memcpy
memset
pthread_cond_broadcast
pthread_cond_wait
sbrk
setTempRet0
strftime
strftime_l
34 changes: 34 additions & 0 deletions tests/other/metadce/hello_libcxx_fastcomp_O2.sent
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
DYNAMICTOP_PTR
___cxa_find_matching_catch
___cxa_free_exception
___cxa_uncaught_exception
___gxx_personality_v0
___lock
___map_file
___resumeException
___setErrNo
___syscall140
___syscall145
___syscall146
___syscall54
___syscall6
___syscall91
___unlock
__addDays
__arraySum
__isLeapYear
_abort
_emscripten_get_heap_size
_emscripten_memcpy_big
_emscripten_resize_heap
_getenv
_llvm_stackrestore
_llvm_stacksave
_pthread_cond_wait
_strftime
_strftime_l
abort
abortOnCannotGrowMemory
getTempRet0
setTempRet0
tempDoublePtr
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
DYNAMICTOP_PTR
___cxa_find_matching_catch
___cxa_free_exception
___cxa_uncaught_exception
___gxx_personality_v0
___lock
___map_file
___resumeException
___setErrNo
___syscall140
___syscall145
___syscall146
___syscall54
___syscall6
___syscall91
___unlock
__addDays
__arraySum
__isLeapYear
_abort
_emscripten_get_heap_size
_emscripten_memcpy_big
_emscripten_resize_heap
_getenv
_llvm_stackrestore
_llvm_stacksave
_pthread_cond_wait
_strftime
_strftime_l
abort
abortOnCannotGrowMemory
getTempRet0
setTempRet0
tempDoublePtr
14 changes: 14 additions & 0 deletions tests/other/metadce/hello_world.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright 2011 The Emscripten Authors. All rights reserved.
// Emscripten is available under two separate licenses, the MIT license and the
// University of Illinois/NCSA Open Source License. Both these licenses can be
// found in the LICENSE file.

#include <stdio.h>

class Test {}; // This will fail in C mode

int main() {
printf("hello, world!\n");
return 0;
}

17 changes: 17 additions & 0 deletions tests/other/metadce/hello_world.sent
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
DYNAMICTOP_PTR
__lock
__setErrNo
__syscall140
__syscall146
__syscall54
__syscall6
__unlock
abortOnCannotGrowMemory
emscripten_get_heap_size
emscripten_memcpy_big
emscripten_resize_heap
flush_NO_FILESYSTEM
memcpy
memset
sbrk
setTempRet0
15 changes: 15 additions & 0 deletions tests/other/metadce/hello_world_O1.sent
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
DYNAMICTOP_PTR
__setErrNo
__syscall140
__syscall146
__syscall54
__syscall6
abortOnCannotGrowMemory
emscripten_get_heap_size
emscripten_memcpy_big
emscripten_resize_heap
flush_NO_FILESYSTEM
memcpy
memset
sbrk
setTempRet0
15 changes: 15 additions & 0 deletions tests/other/metadce/hello_world_O2.sent
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
DYNAMICTOP_PTR
__setErrNo
__syscall140
__syscall146
__syscall54
__syscall6
abortOnCannotGrowMemory
emscripten_get_heap_size
emscripten_memcpy_big
emscripten_resize_heap
flush_NO_FILESYSTEM
memcpy
memset
sbrk
setTempRet0
5 changes: 5 additions & 0 deletions tests/other/metadce/hello_world_O3.sent
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
a
b
c
d
e
Loading

0 comments on commit d449897

Please sign in to comment.