about summary refs log tree commit diff
path: root/tests/run-make/cpp-global-destructors/foo.cpp
diff options
context:
space:
mode:
authorOneirical <manchot@videotron.ca>2024-07-18 13:04:45 -0400
committerOneirical <manchot@videotron.ca>2024-08-02 10:06:07 -0400
commit5b44f800f37e0d3093aa5b89c10eb401bbc600eb (patch)
treed3ec10296f157a07ba11b01a2c20bc54545badae /tests/run-make/cpp-global-destructors/foo.cpp
parent8f641b1b953e04eefc0cede84af169088ebc1401 (diff)
downloadrust-5b44f800f37e0d3093aa5b89c10eb401bbc600eb.tar.gz
rust-5b44f800f37e0d3093aa5b89c10eb401bbc600eb.zip
rewrite and rename issue-36710 to rmake
Diffstat (limited to 'tests/run-make/cpp-global-destructors/foo.cpp')
-rw-r--r--tests/run-make/cpp-global-destructors/foo.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/run-make/cpp-global-destructors/foo.cpp b/tests/run-make/cpp-global-destructors/foo.cpp
new file mode 100644
index 00000000000..8f878c2c272
--- /dev/null
+++ b/tests/run-make/cpp-global-destructors/foo.cpp
@@ -0,0 +1,15 @@
+#include <stdint.h>
+
+struct A {
+    A() { v = 1234; }
+    ~A() { v = 1; }
+    uint32_t v;
+};
+
+A a;
+
+extern "C" {
+    uint32_t get() {
+        return a.v;
+    }
+}