Index: cfe/trunk/lib/Frontend/InitPreprocessor.cpp =================================================================== --- cfe/trunk/lib/Frontend/InitPreprocessor.cpp +++ cfe/trunk/lib/Frontend/InitPreprocessor.cpp @@ -830,7 +830,8 @@ DefineFmt("__UINTPTR", TI.getUIntPtrType(), TI, Builder); DefineTypeWidth("__UINTPTR_WIDTH__", TI.getUIntPtrType(), TI, Builder); - DefineFloatMacros(Builder, "FLT16", &TI.getHalfFormat(), "F16"); + if (TI.hasFloat16Type()) + DefineFloatMacros(Builder, "FLT16", &TI.getHalfFormat(), "F16"); DefineFloatMacros(Builder, "FLT", &TI.getFloatFormat(), "F"); DefineFloatMacros(Builder, "DBL", &TI.getDoubleFormat(), ""); DefineFloatMacros(Builder, "LDBL", &TI.getLongDoubleFormat(), "L"); Index: cfe/trunk/test/Headers/float16.c =================================================================== --- cfe/trunk/test/Headers/float16.c +++ cfe/trunk/test/Headers/float16.c @@ -1,7 +1,11 @@ -// RUN: %clang_cc1 -fsyntax-only -verify -std=c89 -ffreestanding %s -// RUN: %clang_cc1 -fsyntax-only -verify -std=c99 -ffreestanding %s -// RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -ffreestanding %s -// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 -x c++ -ffreestanding %s +// RUN: %clang_cc1 -triple=aarch64-none-none -fsyntax-only -verify -std=c89 \ +// RUN: -ffreestanding %s +// RUN: %clang_cc1 -triple=aarch64-none-none -fsyntax-only -verify \ +// RUN: -std=c99 -ffreestanding %s +// RUN: %clang_cc1 -triple=aarch64-none-none -fsyntax-only -verify -std=c11 \ +// RUN: -ffreestanding %s +// RUN: %clang_cc1 -triple=aarch64-none-none -fsyntax-only -verify \ +// RUN: -std=c++11 -x c++ -ffreestanding %s // expected-no-diagnostics #define __STDC_WANT_IEC_60559_TYPES_EXT__ Index: cfe/trunk/test/Preprocessor/init.c =================================================================== --- cfe/trunk/test/Preprocessor/init.c +++ cfe/trunk/test/Preprocessor/init.c @@ -9166,20 +9166,20 @@ // WEBASSEMBLY-NOT:#define __ELF__ // WEBASSEMBLY-NEXT:#define __FINITE_MATH_ONLY__ 0 // WEBASSEMBLY-NEXT:#define __FLOAT128__ 1 -// WEBASSEMBLY-NEXT:#define __FLT16_DECIMAL_DIG__ 5 -// WEBASSEMBLY-NEXT:#define __FLT16_DENORM_MIN__ 5.9604644775390625e-8F16 -// WEBASSEMBLY-NEXT:#define __FLT16_DIG__ 3 -// WEBASSEMBLY-NEXT:#define __FLT16_EPSILON__ 9.765625e-4F16 -// WEBASSEMBLY-NEXT:#define __FLT16_HAS_DENORM__ 1 -// WEBASSEMBLY-NEXT:#define __FLT16_HAS_INFINITY__ 1 -// WEBASSEMBLY-NEXT:#define __FLT16_HAS_QUIET_NAN__ 1 -// WEBASSEMBLY-NEXT:#define __FLT16_MANT_DIG__ 11 -// WEBASSEMBLY-NEXT:#define __FLT16_MAX_10_EXP__ 4 -// WEBASSEMBLY-NEXT:#define __FLT16_MAX_EXP__ 15 -// WEBASSEMBLY-NEXT:#define __FLT16_MAX__ 6.5504e+4F16 -// WEBASSEMBLY-NEXT:#define __FLT16_MIN_10_EXP__ (-13) -// WEBASSEMBLY-NEXT:#define __FLT16_MIN_EXP__ (-14) -// WEBASSEMBLY-NEXT:#define __FLT16_MIN__ 6.103515625e-5F16 +// WEBASSEMBLY-NOT:#define __FLT16_DECIMAL_DIG__ +// WEBASSEMBLY-NOT:#define __FLT16_DENORM_MIN__ +// WEBASSEMBLY-NOT:#define __FLT16_DIG__ +// WEBASSEMBLY-NOT:#define __FLT16_EPSILON__ +// WEBASSEMBLY-NOT:#define __FLT16_HAS_DENORM__ +// WEBASSEMBLY-NOT:#define __FLT16_HAS_INFINITY__ +// WEBASSEMBLY-NOT:#define __FLT16_HAS_QUIET_NAN__ +// WEBASSEMBLY-NOT:#define __FLT16_MANT_DIG__ +// WEBASSEMBLY-NOT:#define __FLT16_MAX_10_EXP__ +// WEBASSEMBLY-NOT:#define __FLT16_MAX_EXP__ +// WEBASSEMBLY-NOT:#define __FLT16_MAX__ +// WEBASSEMBLY-NOT:#define __FLT16_MIN_10_EXP__ +// WEBASSEMBLY-NOT:#define __FLT16_MIN_EXP__ +// WEBASSEMBLY-NOT:#define __FLT16_MIN__ // WEBASSEMBLY-NEXT:#define __FLT_DECIMAL_DIG__ 9 // WEBASSEMBLY-NEXT:#define __FLT_DENORM_MIN__ 1.40129846e-45F // WEBASSEMBLY-NEXT:#define __FLT_DIG__ 6