Index: lib/Frontend/InitPreprocessor.cpp =================================================================== --- lib/Frontend/InitPreprocessor.cpp +++ lib/Frontend/InitPreprocessor.cpp @@ -952,6 +952,9 @@ Builder.defineMacro("__CLANG_CUDA_APPROX_TRANSCENDENTALS__"); } + if (!LangOpts.GNUAsm) + Builder.defineMacro("__CLANG_NO_GNU_INLINE_ASM"); + // OpenCL definitions. if (LangOpts.OpenCL) { #define OPENCLEXT(Ext) \ Index: lib/Headers/cpuid.h =================================================================== --- lib/Headers/cpuid.h +++ lib/Headers/cpuid.h @@ -152,6 +152,8 @@ #define bit_SMEP 0x00000080 #define bit_ENH_MOVSB 0x00000200 +#ifndef __CLANG_NO_GNU_INLINE_ASM + #if __i386__ #define __cpuid(__level, __eax, __ebx, __ecx, __edx) \ __asm("cpuid" : "=a"(__eax), "=b" (__ebx), "=c"(__ecx), "=d"(__edx) \ @@ -213,3 +215,5 @@ *__sig = __ebx; return __eax; } + +#endif /* __CLANG_NO_GNU_INLINE_ASM */ Index: test/Driver/inline-asm.c =================================================================== --- test/Driver/inline-asm.c +++ test/Driver/inline-asm.c @@ -22,3 +22,9 @@ // RUN: FileCheck --check-prefix=CHECK-NO-GNU-INLINE-ASM %s // CHECK-NO-GNU-INLINE-ASM: "-fno-gnu-inline-asm" + +// RUN: %clang -target x86_64-apple-darwin10 \ +// RUN: -fno-gnu-inline-asm -dM -E %s 2>&1 | \ +// RUN: FileCheck --check-prefix=CHECK-NO-GNU-INLINE-ASM-DEFINE %s + +// CHECK-NO-GNU-INLINE-ASM-DEFINE: #define __CLANG_NO_GNU_INLINE_ASM 1