diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1086,8 +1086,7 @@ A->getOption().getID() == options::OPT_INPUT || A->getOption().getID() == options::OPT_x || A->getOption().getID() == options::OPT_fembed_bitcode || - (A->getOption().getGroup().isValid() && - A->getOption().getGroup().getID() == options::OPT_W_Group)) + A->getOption().matches(options::OPT_W_Group)) continue; ArgStringList ASL; A->render(Args, ASL); diff --git a/clang/test/Frontend/embed-bitcode.ll b/clang/test/Frontend/embed-bitcode.ll --- a/clang/test/Frontend/embed-bitcode.ll +++ b/clang/test/Frontend/embed-bitcode.ll @@ -37,6 +37,11 @@ ; CHECK: @llvm.cmdline = private constant ; CHECK: section "__LLVM,__cmdline" +; check warning options are not embedded +; RUN: %clang_cc1 -triple thumbv7-apple-ios8.0.0 -emit-llvm \ +; RUN: -fembed-bitcode=all -x ir %s -o - -Wall -Wundef-prefix=TEST \ +; RUN: | FileCheck %s -check-prefix=CHECK-WARNING + ; CHECK-ELF: @llvm.embedded.module ; CHECK-ELF: section ".llvmbc" ; CHECK-ELF: @llvm.cmdline @@ -54,6 +59,9 @@ ; CHECK-MARKER: @llvm.cmdline ; CHECK-MARKER: section "__LLVM,__cmdline" +; CHECK-WARNING-NOT: Wall +; CHECK-WARNING-NOT: Wundef-prefix + define i32 @f0() { ret i32 0 }