1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -Wno-null-conversion -fsyntax-only -verify 2*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -triple i686-unknown-unknown %s -Wno-null-conversion -fsyntax-only -verify 3*f4a2713aSLionel Sambuc f()4*f4a2713aSLionel Sambucvoid f() { 5*f4a2713aSLionel Sambuc int* i = __null; 6*f4a2713aSLionel Sambuc i = __null; 7*f4a2713aSLionel Sambuc int i2 = __null; 8*f4a2713aSLionel Sambuc 9*f4a2713aSLionel Sambuc // Verify statically that __null is the right size 10*f4a2713aSLionel Sambuc int a[sizeof(typeof(__null)) == sizeof(void*)? 1 : -1]; 11*f4a2713aSLionel Sambuc 12*f4a2713aSLionel Sambuc // Verify that null is evaluated as 0. 13*f4a2713aSLionel Sambuc int b[__null ? -1 : 1]; 14*f4a2713aSLionel Sambuc } 15*f4a2713aSLionel Sambuc 16*f4a2713aSLionel Sambuc struct A {}; 17*f4a2713aSLionel Sambuc g()18*f4a2713aSLionel Sambucvoid g() { 19*f4a2713aSLionel Sambuc (void)(0 ? __null : A()); // expected-error {{non-pointer operand type 'A' incompatible with NULL}} 20*f4a2713aSLionel Sambuc (void)(0 ? A(): __null); // expected-error {{non-pointer operand type 'A' incompatible with NULL}} 21*f4a2713aSLionel Sambuc } 22