summaryrefslogtreecommitdiff
path: root/ext/-test-/RUBY_ALIGNOF/cpp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ext/-test-/RUBY_ALIGNOF/cpp.cpp')
-rw-r--r--ext/-test-/RUBY_ALIGNOF/cpp.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/-test-/RUBY_ALIGNOF/cpp.cpp b/ext/-test-/RUBY_ALIGNOF/cpp.cpp
new file mode 100644
index 0000000000..ed76d49b9f
--- /dev/null
+++ b/ext/-test-/RUBY_ALIGNOF/cpp.cpp
@@ -0,0 +1,9 @@
+#include "ruby.h"
+#include <cstddef>
+
+struct T {
+ char _;
+ double t;
+};
+
+RBIMPL_STATIC_ASSERT(RUBY_ALIGNOF, RUBY_ALIGNOF(double) == offsetof(T, t));