aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@college-de-france.fr>2019-10-28 11:20:28 +0100
committerXavier Leroy <xavier.leroy@college-de-france.fr>2019-10-28 11:20:28 +0100
commit8fbe9863a920f6351a13c5a7f0028b8640b9319d (patch)
tree1309f93aa1f5377249f7e3a08093d5af25fc91ef /test
parente3f2f81e6ad70c082dbf3dc5f938e8474c46657d (diff)
downloadcompcert-8fbe9863a920f6351a13c5a7f0028b8640b9319d.tar.gz
compcert-8fbe9863a920f6351a13c5a7f0028b8640b9319d.zip
clightgen: sanitize names of functions and global variables
A "dollar" sign in a function name or a global variable name was producing incorrect Coq identifiers. (Issue #319.)
Diffstat (limited to 'test')
-rw-r--r--test/clightgen/issue319.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/clightgen/issue319.c b/test/clightgen/issue319.c
new file mode 100644
index 00000000..be9f3f7e
--- /dev/null
+++ b/test/clightgen/issue319.c
@@ -0,0 +1,12 @@
+/* Dollar signs in identifiers */
+
+int c$d = 42;
+
+int a$b(int x$$) {
+ return c$d + x$$;
+}
+
+int main(int argc, const char *argv[])
+{
+ return a$b(6);
+}