]> granicus.if.org Git - clang/commitdiff
Add the test for __null
authorDouglas Gregor <dgregor@apple.com>
Mon, 1 Dec 2008 17:31:21 +0000 (17:31 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 1 Dec 2008 17:31:21 +0000 (17:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60357 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaCXX/__null.cpp [new file with mode: 0644]

diff --git a/test/SemaCXX/__null.cpp b/test/SemaCXX/__null.cpp
new file mode 100644 (file)
index 0000000..cc04ebc
--- /dev/null
@@ -0,0 +1,10 @@
+// RUN: clang %s -fsyntax-only -verify
+
+void f() {
+  int* i = __null;
+  i = __null;
+  int i2 = __null;
+
+  // Verify statically that __null is the right size
+  int a[sizeof(typeof(__null)) == sizeof(void*)? 1 : -1];
+}