Skip to content

[clang][test] Rewrote test using command substitution to work with lit internal shell syntax #105902

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions clang/test/Modules/compare-file-size.py
Original file line number Diff line number Diff line change
@@ -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()
3 changes: 1 addition & 2 deletions clang/test/Modules/reduced-bmi-size.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Loading