diff options
author | Fangrui Song <maskray@google.com> | 2018-03-02 17:37:04 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2018-03-02 17:37:04 +0000 |
commit | 0a301a194ed9bfe02b8d481d0fd8769aa6c02432 (patch) | |
tree | bc9df7f26c953e0188195ac13c52669d7c2033ce /llvm/utils/UpdateTestChecks/asm.py | |
parent | 852525de25aa24c93a8193e56096d44230c25e7a (diff) | |
download | llvm-0a301a194ed9bfe02b8d481d0fd8769aa6c02432.zip llvm-0a301a194ed9bfe02b8d481d0fd8769aa6c02432.tar.gz llvm-0a301a194ed9bfe02b8d481d0fd8769aa6c02432.tar.bz2 |
[utils] Add utils/update_cc_test_checks.py
A utility to update LLVM IR in C/C++ FileCheck test files.
Example RUN lines in .c/.cc test files:
// RUN: %clang -S -Os -DXX %s -o - | FileCheck %s
// RUN: %clangxx -S -Os %s -o - | FileCheck -check-prefix=IR %s
Usage:
% utils/update_cc_test_checks.py --llvm-bin=release/bin test/a.cc
% utils/update_cc_test_checks.py --c-index-test=release/bin/c-index-test --clang=release/bin/clang /tmp/c/a.cc
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
// RUN: %clang -emit-llvm -S -Os -DXX %s -o - | FileCheck -check-prefix=AA %s
// RUN: %clangxx -emit-llvm -S -Os %s -o - | FileCheck -check-prefix=BB %s
using T =
#ifdef XX
int __attribute__((vector_size(16)))
#else
short __attribute__((vector_size(16)))
#endif
;
// AA-LABEL: _Z3fooDv4_i:
// AA: entry:
// AA-NEXT: %add = shl <4 x i32> %a, <i32 1, i32 1, i32 1, i32 1>
// AA-NEXT: ret <4 x i32> %add
//
// BB-LABEL: _Z3fooDv8_s:
// BB: entry:
// BB-NEXT: %add = shl <8 x i16> %a, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>
// BB-NEXT: ret <8 x i16> %add
T foo(T a) {
return a + a;
}
Differential Revision: https://reviews.llvm.org/D42712
llvm-svn: 326591
Diffstat (limited to 'llvm/utils/UpdateTestChecks/asm.py')
-rw-r--r-- | llvm/utils/UpdateTestChecks/asm.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py index 4b2d3ac..c98dfc9 100644 --- a/llvm/utils/UpdateTestChecks/asm.py +++ b/llvm/utils/UpdateTestChecks/asm.py @@ -94,7 +94,7 @@ def scrub_asm_x86(asm, args): asm = SCRUB_X86_RIP_RE.sub(r'{{.*}}(%rip)', asm) # Generically match a LCP symbol. asm = SCRUB_X86_LCP_RE.sub(r'{{\.LCPI.*}}', asm) - if args.x86_extra_scrub: + if getattr(args, 'x86_extra_scrub', False): # Avoid generating different checks for 32- and 64-bit because of 'retl' vs 'retq'. asm = SCRUB_X86_RET_RE.sub(r'ret{{[l|q]}}', asm) # Strip kill operands inserted into the asm. |