aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/intertyper.js2
-rw-r--r--src/library.js4
-rw-r--r--tests/runner.py20
3 files changed, 22 insertions, 4 deletions
diff --git a/src/intertyper.js b/src/intertyper.js
index fa3b1f45..ee59237e 100644
--- a/src/intertyper.js
+++ b/src/intertyper.js
@@ -290,7 +290,7 @@ function intertyper(data) {
} else {
// variable
var ident = item.tokens[0].text;
- while (item.tokens[2].text in set('private', 'constant', 'appending', 'global', 'weak_odr', 'internal', 'linkonce', 'weak'))
+ while (item.tokens[2].text in set('private', 'constant', 'appending', 'global', 'weak_odr', 'internal', 'linkonce', 'linkonce_odr', 'weak'))
item.tokens.splice(2, 1);
var ret = {
__result__: true,
diff --git a/src/library.js b/src/library.js
index 896aae38..ba854885 100644
--- a/src/library.js
+++ b/src/library.js
@@ -125,10 +125,10 @@ var Library = {
},
__cxa_guard_acquire: function() {
- return 0;
+ return 1;
},
__cxa_guard_release: function() {
- return 0;
+ return 1;
},
llvm_eh_exception: function() {
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