   }
 }
 
-public func fileCheckOutput(of FD : FileCheckFD = .stdout, withPrefixes prefixes : [String] = ["CHECK"], against file : String = #file, options: FileCheckOptions = [], block : () -> ()) -> Bool {
+/// Reads from the given output stream and runs a file verification procedure
+/// by comparing the output to a specified result.
+///
+/// FileCheck requires total access to whatever input stream is being used.  As
+/// such it will override printing to said stream until the given block has
+/// finished executing.
+///
+/// - parameter FD: The file descriptor to override and read from.
+/// - parameter prefixes: Specifies one or more prefixes to match. By default
+///   these patterns are prefixed with "CHECK".
+/// - parameter checkNot: Specifies zero or more prefixes to implicitly reject
+///   in the output stream.  This can be used to implement LLVM-verifier-like 
+///   checks.
+/// - parameter file: The file to check against.  Defaults to the file that
+///   contains the call to `fileCheckOutput`.
+/// - parameter options: Optional arguments to modify the behavior of the check.
+/// - parameter block: The block in which output will be emitted to the given
+///   file descriptor.
+///
+/// - returns: Whether or not FileCheck succeeded in verifying the file.
+public func fileCheckOutput(of FD : FileCheckFD = .stdout, withPrefixes prefixes : [String] = ["CHECK"], checkNot : [String] = [], against file : String = #file, options: FileCheckOptions = [], block : () -> ()) -> Bool {
   guard let validPrefixes = validateCheckPrefixes(prefixes) else {
     print("Supplied check-prefix is invalid! Prefixes must be unique and ",
           "start with a letter and contain only alphanumeric characters, ",
           "hyphens and underscores")
     return false
   }
-  guard let PrefixRE = try? NSRegularExpression(pattern: validPrefixes.joined(separator: "|"), options: []) else {
+  guard let prefixRE = try? NSRegularExpression(pattern: validPrefixes.joined(separator: "|"), options: []) else {
     print("Unable to combine check-prefix strings into a prefix regular ",
           "expression! This is likely a bug in FileCheck's verification of ",
           "the check-prefix strings. Regular expression parsing failed.")


    let (numNewLines, _ /*firstNewLine*/) = countNumNewlinesBetween(buffer)
    if numNewLines != 0 {
      diagnose(.error, self.loc, self.prefix + "-SAME: is not on the same line as the previous match")
      rest.cString(using: .utf8)?.withUnsafeBufferPointer { buf in
        let loc = CheckLoc.inBuffer(buf.baseAddress!, buf)
        diagnose(.note, loc, "'next' match was here")
      }
      buffer.cString(using: .utf8)?.withUnsafeBufferPointer { buf in
        let loc = CheckLoc.inBuffer(buf.baseAddress!, buf)
        diagnose(.note, loc, "previous match ended here")
      }
      return true
    }


      // If this check is a "CHECK-NEXT", verify that the previous match was on
      // the previous line (i.e. that there is one newline between them).
      if self.checkNext(skippedRegion, rest, options) {
        return nil
      }

      // If this check is a "CHECK-SAME", verify that the previous match was on
      // the same line (i.e. that there is no newline between them).
      if self.checkSame(skippedRegion, rest, options) {
        return nil
      }

      // If this match had "not strings", verify that they don't exist in the
      // skipped region.
      if self.checkNot(skippedRegion, notStrings, variableTable, options) {
        return nil
      }
    }
