aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2024-03-22 01:50:07 -0700
committerMichael Forney <mforney@mforney.org>2024-03-22 01:50:07 -0700
commit92c59818b538ae7ca4973b5e0bafa8b7efadcb78 (patch)
treee0545b1df179827448e05fa8e6bd965870e94ed8 /test
parentf24b8ba07d0b2a5f4d81979aa6812bcdf410a365 (diff)
Implement C23 nullptr constant
Diffstat (limited to 'test')
-rw-r--r--test/nullptr.c4
-rw-r--r--test/nullptr.qbe3
2 files changed, 7 insertions, 0 deletions
diff --git a/test/nullptr.c b/test/nullptr.c
new file mode 100644
index 0000000..8f5b436
--- /dev/null
+++ b/test/nullptr.c
@@ -0,0 +1,4 @@
+typeof(nullptr) x = 0;
+_Static_assert(sizeof x == sizeof(char *));
+int *y = nullptr;
+bool z = nullptr;
diff --git a/test/nullptr.qbe b/test/nullptr.qbe
new file mode 100644
index 0000000..c805942
--- /dev/null
+++ b/test/nullptr.qbe
@@ -0,0 +1,3 @@
+export data $x = align 8 { l 0, }
+export data $y = align 8 { l 0, }
+export data $z = align 1 { b 0, }