blob: 3e079cbf8e51e76cdc22167a49517cb7cb69715e [file] [log] [blame]
Reid Kleckner79b0fd72014-10-10 00:05:45 +00001// 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)
David Blaikied6c88ec2015-04-16 23:25:00 +000015// WINDOWS: call void (i8*, ...) @v(i8* {{.*}}, i32 1, i32 2, i32 3, i64 0)
Reid Kleckner79b0fd72014-10-10 00:05:45 +000016// LINUX: define void @f(i8* %f)
David Blaikied6c88ec2015-04-16 23:25:00 +000017// LINUX: call void (i8*, ...) @v(i8* {{.*}}, i32 1, i32 2, i32 3, i32 0)