summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/test/CodeGen/asm-parser-info.S12
-rw-r--r--clang/tools/driver/cc1as_main.cpp3
2 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/CodeGen/asm-parser-info.S b/clang/test/CodeGen/asm-parser-info.S
new file mode 100644
index 00000000000..62145c0a74d
--- /dev/null
+++ b/clang/test/CodeGen/asm-parser-info.S
@@ -0,0 +1,12 @@
+// REQUIRES: x86-registered-target
+// RUN: %clang --target=x86_64-unknown-linux-gnu -c %s -o /dev/null
+
+// Check that cc1as can use assembler info in object generation.
+.data
+
+foo:
+.if . - foo == 0
+ .byte 0xaa
+.else
+ .byte 0x00
+.endif
diff --git a/clang/tools/driver/cc1as_main.cpp b/clang/tools/driver/cc1as_main.cpp
index 1c6cc36e680..05a4d9cf062 100644
--- a/clang/tools/driver/cc1as_main.cpp
+++ b/clang/tools/driver/cc1as_main.cpp
@@ -435,6 +435,9 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts,
Str.get()->InitSections(Opts.NoExecStack);
}
+ // Assembly to object compilation should leverage assembly info.
+ Str->setUseAssemblerInfoForParsing(true);
+
bool Failed = false;
std::unique_ptr<MCAsmParser> Parser(
OpenPOWER on IntegriCloud