aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
authoralon@honor <none@none>2010-10-24 15:43:08 -0700
committeralon@honor <none@none>2010-10-24 15:43:08 -0700
commit46b42f3c027f8848bb11a84307b7c7ed332421ac (patch)
treed38631e669f0c5c1ac330b86390aa4bd62867a26 /tests/runner.py
parentfa7440b389910fefe7b3ea713a21b8a6b44daa6f (diff)
fixes for more complex statics test
Diffstat (limited to 'tests/runner.py')
-rw-r--r--tests/runner.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/runner.py b/tests/runner.py
index c87ac416..797a21b5 100644
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -806,12 +806,30 @@ if 'benchmark' not in sys.argv:
puts(buf);
}
+ struct XYZ {
+ float x, y, z;
+ XYZ(float a, float b, float c) : x(a), y(b), z(c) { }
+ static const XYZ& getIdentity()
+ {
+ static XYZ iT(1,2,3);
+ return iT;
+ }
+ };
+ struct S {
+ static const XYZ& getIdentity()
+ {
+ static const XYZ iT(XYZ::getIdentity());
+ return iT;
+ }
+ };
+
int main() {
conoutfv("*staticccz*");
+ printf("*%.2f,%.2f,%.2f*\\n", S::getIdentity().x, S::getIdentity().y, S::getIdentity().z);
return 0;
}
'''
- self.do_test(src, '*staticccz*')
+ self.do_test(src, '*staticccz*\n*1.00,2.00,3.00*')
def test_copyop(self):
# clang generated code is vulnerable to this, as it uses