// Honor -fpack-struct= and -fpack-struct, if given. Note that
// -fno-pack-struct doesn't apply to -fpack-struct=.
if (Arg *A = Args.getLastArg(options::OPT_fpack_struct_EQ)) {
- CmdArgs.push_back("-fpack-struct");
- CmdArgs.push_back(A->getValue(Args));
+ std::string PackStructStr = "-fpack-struct=";
+ PackStructStr += A->getValue(Args);
+ CmdArgs.push_back(Args.MakeArgString(PackStructStr));
} else if (Args.hasFlag(options::OPT_fpack_struct,
options::OPT_fno_pack_struct, false)) {
- CmdArgs.push_back("-fpack-struct");
- CmdArgs.push_back("1");
+ CmdArgs.push_back("-fpack-struct=1");
}
if (Args.hasArg(options::OPT_mkernel) ||
--- /dev/null
+// RUN: %clang -fpack-struct -### %s 2> %t
+// RUN: FileCheck < %t %s
+// RUN: %clang -fpack-struct=8 -### %s 2> %t
+// RUN: FileCheck < %t %s --check-prefix=EQ
+
+// CHECK: "-cc1"
+// CHECK: "-fpack-struct=1"
+
+// CHECK-EQ: "-cc1"
+// CHECK-EQ: "-fpack-struct=8"