
import os
import sys

assert len(sys.argv) >= 2
timeVal = int(sys.argv[1])

# offset between Unix and LLVM epochs
timeVal += 946684800

# Update the output file mtime, or create it if necessary.
# From http://stackoverflow.com/a/1160227.
for outputFile in sys.argv[1:]:
    with open(outputFile, 'a'):
        os.utime(outputFile, (timeVal, timeVal))


import os
import sys

assert len(sys.argv) >= 2
timeVal = int(sys.argv[1])

# Update the output file mtime, or create it if necessary.
# From http://stackoverflow.com/a/1160227.
for outputFile in sys.argv[1:]:
    with open(outputFile, 'a'):
        os.utime(outputFile, (timeVal, timeVal))

Fix tests for file timestamps to drop the LLVM epoch offset.
Fix tests for file timestamps to drop the LLVM epoch offset.

Now that Swift is not using LLVM's TimeValue (564fc6f2 and previous commit)
there is no offset from the system_clock epoch. The offset could be added
into the tests that use touch.py (so the times would not be back in 1984)
but I decided not to do that to avoid merge conflicts in the test files.

  
  import os
  import sys
  
  assert len(sys.argv) >= 2
  timeVal = int(sys.argv[1])
  
- # offset between Unix and LLVM epochs
- timeVal += 946684800
- 
  # Update the output file mtime, or create it if necessary.
  # From http://stackoverflow.com/a/1160227.
  for outputFile in sys.argv[1:]:
      with open(outputFile, 'a'):
          os.utime(outputFile, (timeVal, timeVal))
  
Fix tests for file timestamps to drop the LLVM epoch offset.
## Code Before:

import os
import sys

assert len(sys.argv) >= 2
timeVal = int(sys.argv[1])

# offset between Unix and LLVM epochs
timeVal += 946684800

# Update the output file mtime, or create it if necessary.
# From http://stackoverflow.com/a/1160227.
for outputFile in sys.argv[1:]:
    with open(outputFile, 'a'):
        os.utime(outputFile, (timeVal, timeVal))

## Instruction:
Fix tests for file timestamps to drop the LLVM epoch offset.
## Code After:

import os
import sys

assert len(sys.argv) >= 2
timeVal = int(sys.argv[1])

# Update the output file mtime, or create it if necessary.
# From http://stackoverflow.com/a/1160227.
for outputFile in sys.argv[1:]:
    with open(outputFile, 'a'):
        os.utime(outputFile, (timeVal, timeVal))
