aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2013-02-01 22:20:04 +0200
committerJukka Jylänki <jujjyl@gmail.com>2013-02-01 22:20:04 +0200
commitc40babef1f7774dde1a7eaa16fddc59929539481 (patch)
tree95df41b82f2ba8bea76e1d6e707d319fbaedeb77 /tests
parent24fe400832f5c734655ded971c9223913a5f0455 (diff)
Add a unit test that checks that all platforms are building C++03 code by default.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/runner.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 1b0852f4..a22256c3 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -3513,6 +3513,25 @@ def process(filename):
'''
self.do_run(src, '*96,97,98,-14,-14,101*')
+ # By default, when user has not specified a -std flag, Emscripten should always build .cpp files using the C++03 standard,
+ # i.e. as if "-std=c++03" had been passed on the command line. On Linux with Clang 3.2 this is the case, but on Windows
+ # with Clang 3.2 -std=c++11 has been chosen as default, because of
+ # < jrose> clb: it's deliberate, with the idea that for people who don't care about the standard, they should be using the "best" thing we can offer on that platform
+ def test_cxx03(self):
+ src = '''
+ #include <stdio.h>
+
+ #if __cplusplus != 199711L
+ #error By default, if no -std is specified, emscripten should be compiling with -std=c++03!
+ #endif
+
+ int main( int argc, const char *argv[] ) {
+ printf("Hello world!\\n");
+ return 0;
+ }
+ '''
+ self.do_run(src, 'Hello world!')
+
def test_bigswitch(self):
if Settings.RELOOP: return self.skip('TODO: switch in relooper, issue #781')