[flang] Fix bug in test_modfile.sh
authorTim Keith <tkeith@nvidia.com>
Thu, 28 Feb 2019 19:05:49 +0000 (11:05 -0800)
committerTim Keith <tkeith@nvidia.com>
Thu, 28 Feb 2019 19:05:49 +0000 (11:05 -0800)
The expected mod files specified in the test do not necessarily
appear in sorted order, and the desired order depends on what the
`comm` command expects. So sort them to be sure it is right.

Original-commit: flang-compiler/f18@730d0d0562dd0a4eabfde020fef9fe371d401ff5
Reviewed-on: https://github.com/flang-compiler/f18/pull/309

flang/test/semantics/test_modfile.sh

index 69ed0f4..939155d 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-# Copyright (c) 2018, NVIDIA CORPORATION.  All rights reserved.
+# Copyright (c) 2018-2019, NVIDIA CORPORATION.  All rights reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -46,7 +46,7 @@ for src in "$@"; do
     $CMD $src
     ls -1 *.mod | comm -13 prev_files -
   ) > $actual_files
-  expected_files=$(sed -n 's/^!Expect: \(.*\)/\1/p' $src)
+  expected_files=$(sed -n 's/^!Expect: \(.*\)/\1/p' $src | sort)
   extra_files=$(echo "$expected_files" | comm -23 $actual_files -)
   if [[ ! -z "$extra_files" ]]; then
     echo "Unexpected .mod files produced:" $extra_files