aboutsummaryrefslogtreecommitdiffstats
path: root/3rdparty/pybind11/tests/test_union.cpp
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2020-07-27 13:50:42 +0100
committerGitHub <noreply@github.com>2020-07-27 13:50:42 +0100
commitb39a2a502065ec1407417ffacdac2154385bf80f (patch)
tree3349c93ac87f5758009c53b3e2eb5b9a130cd0d6 /3rdparty/pybind11/tests/test_union.cpp
parente6991ad5dc79f6118838f091cc05f10d3377eb4a (diff)
parentfe398ab983aee9283f61c288dc98d94542c30332 (diff)
downloadnextpnr-b39a2a502065ec1407417ffacdac2154385bf80f.tar.gz
nextpnr-b39a2a502065ec1407417ffacdac2154385bf80f.tar.bz2
nextpnr-b39a2a502065ec1407417ffacdac2154385bf80f.zip
Merge pull request #477 from YosysHQ/pybind11
Move to pybind11
Diffstat (limited to '3rdparty/pybind11/tests/test_union.cpp')
-rw-r--r--3rdparty/pybind11/tests/test_union.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/3rdparty/pybind11/tests/test_union.cpp b/3rdparty/pybind11/tests/test_union.cpp
new file mode 100644
index 00000000..7b98ea21
--- /dev/null
+++ b/3rdparty/pybind11/tests/test_union.cpp
@@ -0,0 +1,22 @@
+/*
+ tests/test_class.cpp -- test py::class_ definitions and basic functionality
+
+ Copyright (c) 2019 Roland Dreier <roland.dreier@gmail.com>
+
+ All rights reserved. Use of this source code is governed by a
+ BSD-style license that can be found in the LICENSE file.
+*/
+
+#include "pybind11_tests.h"
+
+TEST_SUBMODULE(union_, m) {
+ union TestUnion {
+ int value_int;
+ unsigned value_uint;
+ };
+
+ py::class_<TestUnion>(m, "TestUnion")
+ .def(py::init<>())
+ .def_readonly("as_int", &TestUnion::value_int)
+ .def_readwrite("as_uint", &TestUnion::value_uint);
+}