From 92c59818b538ae7ca4973b5e0bafa8b7efadcb78 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Fri, 22 Mar 2024 01:50:07 -0700 Subject: Implement C23 nullptr constant --- test/nullptr.c | 4 ++++ test/nullptr.qbe | 3 +++ 2 files changed, 7 insertions(+) create mode 100644 test/nullptr.c create mode 100644 test/nullptr.qbe (limited to 'test') 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, } -- cgit v1.2.3