Index: clang/lib/Headers/pconfigintrin.h =================================================================== --- clang/lib/Headers/pconfigintrin.h +++ clang/lib/Headers/pconfigintrin.h @@ -16,6 +16,8 @@ #define __PCONFIG_KEY_PROGRAM 0x00000001 +#if __has_extension(gnu_asm) + /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS \ __attribute__((__always_inline__, __nodebug__, __target__("pconfig"))) @@ -33,4 +35,6 @@ #undef __DEFAULT_FN_ATTRS +#endif /* __has_extension(gnu_asm) */ + #endif Index: clang/lib/Headers/sgxintrin.h =================================================================== --- clang/lib/Headers/sgxintrin.h +++ clang/lib/Headers/sgxintrin.h @@ -14,6 +14,8 @@ #ifndef __SGXINTRIN_H #define __SGXINTRIN_H +#if __has_extension(gnu_asm) + /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS \ __attribute__((__always_inline__, __nodebug__, __target__("sgx"))) @@ -53,4 +55,6 @@ #undef __DEFAULT_FN_ATTRS +#endif /* __has_extension(gnu_asm) */ + #endif Index: clang/test/Modules/compiler_builtins_x86.c =================================================================== --- clang/test/Modules/compiler_builtins_x86.c +++ clang/test/Modules/compiler_builtins_x86.c @@ -1,6 +1,7 @@ // RUN: rm -rf %t // RUN: %clang_cc1 -triple i686-unknown-unknown -fsyntax-only -fmodules -fimplicit-module-maps -fmodules-cache-path=%t %s -verify -ffreestanding // RUN: %clang_cc1 -triple i686-unknown-unknown -fsyntax-only -fmodules -fmodule-map-file=%resource_dir/module.modulemap -fmodules-cache-path=%t %s -verify -ffreestanding +// RUN: %clang_cc1 -triple i686-unknown-unknown -fsyntax-only -fmodules -fimplicit-module-maps -fmodules-cache-path=%t %s -verify -ffreestanding -fno-gnu-inline-asm // expected-no-diagnostics #include