diff --git a/clang/test/Modules/compare-file-size.py b/clang/test/Modules/compare-file-size.py new file mode 100644 index 0000000000000..8988d91cbcc2c --- /dev/null +++ b/clang/test/Modules/compare-file-size.py @@ -0,0 +1,20 @@ +# This program takes in two file path arguments in the form 'compare-file-size.py file1 file2' +# Returns true if the file size of the file1 is smaller than the file size of file2 + +import argparse +import os + + +def main(): + parser = argparse.ArgumentParser() + + parser.add_argument("file1", type=str) + parser.add_argument("file2", type=str) + + args = parser.parse_args() + + return os.path.getsize(args.file1) < os.path.getsize(args.file2) + + +if __name__ == "__main__": + main() diff --git a/clang/test/Modules/reduced-bmi-size.cppm b/clang/test/Modules/reduced-bmi-size.cppm index 664f45f5c6a5a..6e3323266561e 100644 --- a/clang/test/Modules/reduced-bmi-size.cppm +++ b/clang/test/Modules/reduced-bmi-size.cppm @@ -10,7 +10,6 @@ // RUN: %clang_cc1 -std=c++20 -emit-module-interface %s -o %t/a.pcm // RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %s -o %t/a.reduced.pcm // -// %s implies the current source file. So we can't use it directly. -// RUN: [ $(stat -c%\s "%t/a.pcm") -le $(stat -c%\s "%t/a.reduced.pcm") ] +// RUN: %python %S/compare-file-size.py %t/a.pcm %t/a.reduced.pcm export module a;