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