Compiler projects using llvm
# REQUIRES: x86-registered-target

# RUN: cp -f %S/Inputs/common-label-different-bodies-1.ll %t-1.ll
# RUN: cp -f %S/Inputs/common-label-different-bodies-2.ll %t-2.ll
# RUN: cp -f %S/Inputs/common-label-different-bodies-3.ll %t-3.ll
# RUN: %update_llc_test_checks %t-1.ll

# re-running update_llc_test_checks leaves the file as-is.
# RUN: cp -f %t-1.ll %t-1-copy.ll
# RUN: %update_llc_test_checks %t-1.ll
# RUN: diff %t-1.ll %t-1-copy.ll
# RUN: %update_llc_test_checks %t-2.ll
# RUN: %update_llc_test_checks %t-3.ll
# RUN: FileCheck --input-file=%t-1.ll %s --check-prefixes=CHECK,CHECK-UNUSED
# RUN: FileCheck --input-file=%t-2.ll %s
# RUN: FileCheck --input-file=%t-3.ll %s

# CHECK: B-LABEL: fold_v2i64
# CHECK-NOT: A-LABEL: fold_v2i64
# CHECK: NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
# CHECK-NEXT: A:
# CHECK-UNUSED-NEXT: UNUSED:

# adding a test removes that label from "unused" prefixes list
# the input file is like "1" after the tool was run, and then we added a new test
# RUN: cp -f %S/Inputs/common-label-different-bodies-1-next.ll %t-1-next.ll
# RUN: %update_llc_test_checks %t-1-next.ll
# RUN: FileCheck --input-file=%t-1-next.ll %s --check-prefixes=AFTER-CHANGE

# AFTER-CHANGE: NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
# AFTER-CHANGE-NEXT: UNUSED:
# AFTER-CHANGE-NOT: A: