1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 %s -emit-llvm -o - -triple x86_64-windows-msvc | FileCheck %s --check-prefix=WINDOWS
2*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 %s -emit-llvm -o - -triple x86_64-linux | FileCheck %s --check-prefix=LINUX
3*0a6a1f1dSLionel Sambuc
4*0a6a1f1dSLionel Sambuc // Make it possible to pass NULL through variadic functions on platforms where
5*0a6a1f1dSLionel Sambuc // NULL has an integer type that is more narrow than a pointer. On such
6*0a6a1f1dSLionel Sambuc // platforms we widen null pointer constants to a pointer-sized integer.
7*0a6a1f1dSLionel Sambuc
8*0a6a1f1dSLionel Sambuc #define NULL 0
9*0a6a1f1dSLionel Sambuc
10*0a6a1f1dSLionel Sambuc void v(const char *f, ...);
f(const char * f)11*0a6a1f1dSLionel Sambuc void f(const char *f) {
12*0a6a1f1dSLionel Sambuc v(f, 1, 2, 3, NULL);
13*0a6a1f1dSLionel Sambuc }
14*0a6a1f1dSLionel Sambuc // WINDOWS: define void @f(i8* %f)
15*0a6a1f1dSLionel Sambuc // WINDOWS: call void (i8*, ...)* @v(i8* {{.*}}, i32 1, i32 2, i32 3, i64 0)
16*0a6a1f1dSLionel Sambuc // LINUX: define void @f(i8* %f)
17*0a6a1f1dSLionel Sambuc // LINUX: call void (i8*, ...)* @v(i8* {{.*}}, i32 1, i32 2, i32 3, i32 0)
18