xref: /llvm-project/llvm/test/tools/UpdateTestChecks/update_test_checks/basic.test (revision fb309041f0c37fa2798305ae02cf6910bf0b402b)
1240aff80SAlex Richardson# REQUIRES: x86-registered-target
2240aff80SAlex Richardson## Basic test checking that update_test_checks.py works correctly
3240aff80SAlex Richardson# RUN: cp -f %S/Inputs/basic.ll %t.ll && %update_test_checks %t.ll
4240aff80SAlex Richardson# RUN: diff -u %t.ll %S/Inputs/basic.ll.expected
5240aff80SAlex Richardson## Check that running the script again does not change the result:
6240aff80SAlex Richardson# RUN: %update_test_checks %t.ll
7240aff80SAlex Richardson# RUN: diff -u %t.ll %S/Inputs/basic.ll.expected
8240aff80SAlex Richardson## Also try the --function-signature flag
9240aff80SAlex Richardson# RUN: %update_test_checks %t.ll --function-signature
10240aff80SAlex Richardson# RUN: diff -u %t.ll %S/Inputs/basic.ll.funcsig.expected
111698cc7eSJohannes Doerfert## Verify that running without the --function-signature flag does not removes
121698cc7eSJohannes Doerfert## the -SAME: lines since the generated file will have --function-signature in
131698cc7eSJohannes Doerfert## an UTC_ARGS: comment in the first line (from the invocation above) which is
141698cc7eSJohannes Doerfert## added to the update invocation below.
15240aff80SAlex Richardson# RUN: %update_test_checks %t.ll
161698cc7eSJohannes Doerfert# RUN: diff -u %t.ll %S/Inputs/basic.ll.funcsig.expected
17*fb309041SNikita Popov## Restore the original file without --function-signature and check that
18*fb309041SNikita Popov## --version 2 will implicitly enable it and also check the return type.
19*fb309041SNikita Popov# RUN: cp -f %S/Inputs/basic.ll %t.ll
20*fb309041SNikita Popov# RUN: %update_test_checks %t.ll --version 2
21*fb309041SNikita Popov# RUN: diff -u %t.ll %S/Inputs/basic.ll.v2.expected
22