File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
compiler/rustc_llvm/llvm-wrapper Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -436,7 +436,8 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
436436 Options.FunctionSections = FunctionSections;
437437 Options.UniqueSectionNames = UniqueSectionNames;
438438 Options.MCOptions .AsmVerbose = AsmComments;
439- Options.MCOptions .PreserveAsmComments = AsmComments;
439+ // Always preserve comments that were written by the user
440+ Options.MCOptions .PreserveAsmComments = true ;
440441 Options.MCOptions .ABIName = ABIStr;
441442 if (SplitDwarfFile) {
442443 Options.MCOptions .SplitDwarfFile = SplitDwarfFile;
Original file line number Diff line number Diff line change 1+ //@ assembly-output: emit-asm
2+ //@ only-x86_64
3+ // Check that comments in assembly get passed
4+
5+ #![ crate_type = "lib" ]
6+
7+ // CHECK-LABEL: test_comments:
8+ #[ no_mangle]
9+ pub fn test_comments ( ) {
10+ // CHECK: example comment
11+ unsafe { core:: arch:: asm!( "nop // example comment" ) } ;
12+ }
You can’t perform that action at this time.
0 commit comments