1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -disable-output -S -passes=print-ir-similarity < %s 2>&1 | FileCheck --allow-empty %s
4 ; Check to make sure that the IRSimilarityIdentifier and IRSimilarityPrinterPass
5 ; return items only within the same function when there are different sets of
6 ; instructions in functions.
8 ; CHECK: 2 candidates of length 5. Found in:
9 ; CHECK-NEXT: Function: fish, Basic Block: entry
10 ; CHECK-NEXT: Start Instruction: store i32 6, ptr %0, align 4
11 ; CHECK-NEXT: End Instruction: store i32 4, ptr %4, align 4
12 ; CHECK-NEXT: Function: fish, Basic Block: entry
13 ; CHECK-NEXT: Start Instruction: store i32 1, ptr %1, align 4
14 ; CHECK-NEXT: End Instruction: store i32 5, ptr %5, align 4
15 ; CHECK-NEXT: 2 candidates of length 3. Found in:
16 ; CHECK-NEXT: Function: turtle, Basic Block: (unnamed)
17 ; CHECK-NEXT: Start Instruction: %b = load i32, ptr %1, align 4
18 ; CHECK-NEXT: End Instruction: %d = load i32, ptr %3, align 4
19 ; CHECK-NEXT: Function: turtle, Basic Block: (unnamed)
20 ; CHECK-NEXT: Start Instruction: %a = load i32, ptr %0, align 4
21 ; CHECK-NEXT: End Instruction: %c = load i32, ptr %2, align 4
23 define linkonce_odr void @fish() {
25 %0 = alloca i32, align 4
26 %1 = alloca i32, align 4
27 %2 = alloca i32, align 4
28 %3 = alloca i32, align 4
29 %4 = alloca i32, align 4
30 %5 = alloca i32, align 4
31 store i32 6, ptr %0, align 4
32 store i32 1, ptr %1, align 4
33 store i32 2, ptr %2, align 4
34 store i32 3, ptr %3, align 4
35 store i32 4, ptr %4, align 4
36 store i32 5, ptr %5, align 4
40 define void @turtle(ptr %0, ptr %1, ptr %2, ptr %3) {
47 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: