support for std::endl and cout << ints
This commit is contained in:
Родитель
3c17526474
Коммит
1865466edf
|
@ -4320,6 +4320,16 @@ LibraryManager.library = {
|
|||
_fputs(str, _stdout); // XXX stderr etc.
|
||||
},
|
||||
|
||||
_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEi__deps: ['fputs', '$libcxx'],
|
||||
_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEi: function(stream, num) {
|
||||
_fputs(allocate(intArrayFromString(num.toString()), 'i8', ALLOC_STACK), _stdout);
|
||||
},
|
||||
|
||||
_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRS3_S4_E__deps: ['fputc', '$libcxx'],
|
||||
_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRS3_S4_E: function(stream, x) {
|
||||
_fputc('\n'.charCodeAt(0), _stdout);
|
||||
},
|
||||
|
||||
// glibc
|
||||
|
||||
_ZNSt8ios_base4InitC1Ev: function() {
|
||||
|
|
|
@ -1181,6 +1181,7 @@ basic_ostream<_CharT, _Traits>::seekp(off_type __off, ios_base::seekdir __dir)
|
|||
return *this;
|
||||
}
|
||||
|
||||
*/
|
||||
template <class _CharT, class _Traits>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
|
@ -1209,6 +1210,7 @@ flush(basic_ostream<_CharT, _Traits>& __os)
|
|||
return __os;
|
||||
}
|
||||
|
||||
/*
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class _Stream, class _Tp>
|
||||
|
|
|
@ -3482,12 +3482,12 @@ at function.:blag
|
|||
|
||||
int main()
|
||||
{
|
||||
std::cout << "hello world";
|
||||
std::cout << "hello world" << std::endl << 77 << "." << std::endl;
|
||||
return 0;
|
||||
}
|
||||
'''
|
||||
|
||||
self.do_run(src, 'hello world')
|
||||
self.do_run(src, 'hello world\n77.\n')
|
||||
|
||||
def test_stdvec(self):
|
||||
src = '''
|
||||
|
|
Загрузка…
Ссылка в новой задаче