diff --git a/clang/lib/Headers/CMakeLists.txt b/clang/lib/Headers/CMakeLists.txt --- a/clang/lib/Headers/CMakeLists.txt +++ b/clang/lib/Headers/CMakeLists.txt @@ -38,6 +38,7 @@ avxvnniintrin.h bmi2intrin.h bmiintrin.h + builtins.h __clang_cuda_builtin_vars.h __clang_cuda_math.h __clang_cuda_cmath.h diff --git a/clang/lib/Headers/builtins.h b/clang/lib/Headers/builtins.h new file mode 100644 --- /dev/null +++ b/clang/lib/Headers/builtins.h @@ -0,0 +1,16 @@ +/*===---- builtins.h - Standard header for extra builtins -----------------===*\ + * + * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. + * See https://llvm.org/LICENSE.txt for license information. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + * +\*===----------------------------------------------------------------------===*/ + +/// Some legacy compilers have builtin definitions in a file named builtins.h. +/// This header file has been added to allow compatibility with code that was +/// written for those compilers. Code may have an include line for this file +/// and to avoid an error an empty file with this name is provided. +#ifndef __BUILTINS_H +#define __BUILTINS_H + +#endif /* __BUILTINS_H */ diff --git a/clang/test/Headers/builtins-header.c b/clang/test/Headers/builtins-header.c new file mode 100644 --- /dev/null +++ b/clang/test/Headers/builtins-header.c @@ -0,0 +1,8 @@ +// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -ffreestanding -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple powerpc64le-unknown-unknown -ffreestanding -emit-llvm -o - %s | FileCheck %s + +#include + +// Verify that we can include + +// CHECK: target triple = "powerpc64