Files
swift-mirror/test/Serialization/write-to-locked-dir.swift
Jordan Rose de882dbf62 [Serialization] Fix improper handling of intermediate files.
The old code misused clang::CompilerInstance::createOutputFile (which should
really be sunk down to LLVM). That API specifically handles the case where you
can write to the final output file, but not to anything else in that directory.

I'm fixing this (and cleaning up the code) because of a copy/paste error Dmitri
noticed, where the temp file for the .swiftdoc output would be created as if it
were for the .swiftmodule file. This is also now fixed, and the copy/paste code
has been refactored.

This change should only really affect the case described above, so it's not urgent.

Swift SVN r30206
2015-07-15 00:31:33 +00:00

11 lines
383 B
Swift

// RUN: rm -rf %t && mkdir %t
// RUN: touch %t/main.swiftmodule %t/main.swiftdoc
// RUN: chmod -w %t
// RUN: %target-swift-frontend -emit-module -emit-module-doc -parse-stdlib -o %t -module-name main %s || chmod +w %t
// This is not combined with the previous chmod because of pipefail mode.
// RUN: chmod +w %t
// RUN: test -s %t/main.swiftmodule
// RUN: test -s %t/main.swiftdoc