aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/runner.py')
-rw-r--r--tests/runner.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 790171bb..901adc8e 100644
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -2910,6 +2910,8 @@ if 'benchmark' not in str(sys.argv):
self.do_run(src, expected)
CORRECT_SIGNS = 0
+ # libc++ tests
+
def test_iostream(self):
src = '''
#include <iostream>
@@ -2923,6 +2925,41 @@ if 'benchmark' not in str(sys.argv):
self.do_run(src, 'hello world')
+ def test_stdvec(self):
+ src = '''
+ #include <vector>
+ #include <stdio.h>
+
+ struct S {
+ int a;
+ float b;
+ };
+
+ void foo(int a, float b)
+ {
+ printf("%d:%.2f\\n", a, b);
+ }
+
+ int main ( int argc, char *argv[] )
+ {
+ std::vector<S> ar;
+ S s;
+
+ s.a = 789;
+ s.b = 123.456f;
+ ar.push_back(s);
+
+ s.a = 0;
+ s.b = 100.1f;
+ ar.push_back(s);
+
+ foo(ar[0].a, ar[0].b);
+ foo(ar[1].a, ar[1].b);
+ }
+ '''
+
+ self.do_run(src, '789:123.46\n0:100.1')
+
### 'Big' tests
def test_fannkuch(self):