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 %s
4 ; This is a simple test to make sure the IRSimilarityIdentifier and
5 ; IRSimilarityPrinterPass is working.
7 ; CHECK: 4 candidates of length 6. Found in:
8 ; CHECK-NEXT: Function: turtle, Basic Block: (unnamed)
9 ; CHECK-NEXT: Start Instruction: store i32 1, ptr %1, align 4
10 ; CHECK-NEXT: End Instruction: store i32 6, ptr %6, align 4
11 ; CHECK-NEXT: Function: cat, Basic Block: entry
12 ; CHECK-NEXT: Start Instruction: store i32 6, ptr %0, align 4
13 ; CHECK-NEXT: End Instruction: store i32 5, ptr %5, align 4
14 ; CHECK-NEXT: Function: fish, Basic Block: entry
15 ; CHECK-NEXT: Start Instruction: store i32 6, ptr %0, align 4
16 ; CHECK-NEXT: End Instruction: store i32 5, ptr %5, align 4
17 ; CHECK-NEXT: Function: dog, Basic Block: entry
18 ; CHECK-NEXT: Start Instruction: store i32 6, ptr %0, align 4
19 ; CHECK-NEXT: End Instruction: store i32 5, ptr %5, align 4
20 ; CHECK-NEXT:4 candidates of length 5. Found in:
21 ; CHECK-NEXT: Function: turtle, Basic Block: (unnamed)
22 ; CHECK-NEXT: Start Instruction: store i32 2, ptr %2, align 4
23 ; CHECK-NEXT: End Instruction: store i32 6, ptr %6, align 4
24 ; CHECK-NEXT: Function: cat, Basic Block: entry
25 ; CHECK-NEXT: Start Instruction: store i32 1, ptr %1, align 4
26 ; CHECK-NEXT: End Instruction: store i32 5, ptr %5, align 4
27 ; CHECK-NEXT: Function: fish, Basic Block: entry
28 ; CHECK-NEXT: Start Instruction: store i32 1, ptr %1, align 4
29 ; CHECK-NEXT: End Instruction: store i32 5, ptr %5, align 4
30 ; CHECK-NEXT: Function: dog, Basic Block: entry
31 ; CHECK-NEXT: Start Instruction: store i32 1, ptr %1, align 4
32 ; CHECK-NEXT: End Instruction: store i32 5, ptr %5, align 4
33 ; CHECK-NEXT:4 candidates of length 4. Found in:
34 ; CHECK-NEXT: Function: turtle, Basic Block: (unnamed)
35 ; CHECK-NEXT: Start Instruction: store i32 3, ptr %3, align 4
36 ; CHECK-NEXT: End Instruction: store i32 6, ptr %6, align 4
37 ; CHECK-NEXT: Function: cat, Basic Block: entry
38 ; CHECK-NEXT: Start Instruction: store i32 2, ptr %2, align 4
39 ; CHECK-NEXT: End Instruction: store i32 5, ptr %5, align 4
40 ; CHECK-NEXT: Function: fish, Basic Block: entry
41 ; CHECK-NEXT: Start Instruction: store i32 2, ptr %2, align 4
42 ; CHECK-NEXT: End Instruction: store i32 5, ptr %5, align 4
43 ; CHECK-NEXT: Function: dog, Basic Block: entry
44 ; CHECK-NEXT: Start Instruction: store i32 2, ptr %2, align 4
45 ; CHECK-NEXT: End Instruction: store i32 5, ptr %5, align 4
46 ; CHECK-NEXT:4 candidates of length 3. Found in:
47 ; CHECK-NEXT: Function: turtle, Basic Block: (unnamed)
48 ; CHECK-NEXT: Start Instruction: store i32 4, ptr %4, align 4
49 ; CHECK-NEXT: End Instruction: store i32 6, ptr %6, align 4
50 ; CHECK-NEXT: Function: cat, Basic Block: entry
51 ; CHECK-NEXT: Start Instruction: store i32 3, ptr %3, align 4
52 ; CHECK-NEXT: End Instruction: store i32 5, ptr %5, align 4
53 ; CHECK-NEXT: Function: fish, Basic Block: entry
54 ; CHECK-NEXT: Start Instruction: store i32 3, ptr %3, align 4
55 ; CHECK-NEXT: End Instruction: store i32 5, ptr %5, align 4
56 ; CHECK-NEXT: Function: dog, Basic Block: entry
57 ; CHECK-NEXT: Start Instruction: store i32 3, ptr %3, align 4
58 ; CHECK-NEXT: End Instruction: store i32 5, ptr %5, align 4
59 ; CHECK-NEXT:4 candidates of length 2. Found in:
60 ; CHECK-NEXT: Function: turtle, Basic Block: (unnamed)
61 ; CHECK-NEXT: Start Instruction: store i32 5, ptr %5, align 4
62 ; CHECK-NEXT: End Instruction: store i32 6, ptr %6, align 4
63 ; CHECK-NEXT: Function: cat, Basic Block: entry
64 ; CHECK-NEXT: Start Instruction: store i32 4, ptr %4, align 4
65 ; CHECK-NEXT: End Instruction: store i32 5, ptr %5, align 4
66 ; CHECK-NEXT: Function: fish, Basic Block: entry
67 ; CHECK-NEXT: Start Instruction: store i32 4, ptr %4, align 4
68 ; CHECK-NEXT: End Instruction: store i32 5, ptr %5, align 4
69 ; CHECK-NEXT: Function: dog, Basic Block: entry
70 ; CHECK-NEXT: Start Instruction: store i32 4, ptr %4, align 4
71 ; CHECK-NEXT: End Instruction: store i32 5, ptr %5, align 4
73 define linkonce_odr void @fish() {
75 %0 = alloca i32, align 4
76 %1 = alloca i32, align 4
77 %2 = alloca i32, align 4
78 %3 = alloca i32, align 4
79 %4 = alloca i32, align 4
80 %5 = alloca i32, align 4
81 store i32 6, ptr %0, align 4
82 store i32 1, ptr %1, align 4
83 store i32 2, ptr %2, align 4
84 store i32 3, ptr %3, align 4
85 store i32 4, ptr %4, align 4
86 store i32 5, ptr %5, align 4
90 define void @turtle() {
91 %1 = alloca i32, align 4
92 %2 = alloca i32, align 4
93 %3 = alloca i32, align 4
94 %4 = alloca i32, align 4
95 %5 = alloca i32, align 4
96 %6 = alloca i32, align 4
97 store i32 1, ptr %1, align 4
98 store i32 2, ptr %2, align 4
99 store i32 3, ptr %3, align 4
100 store i32 4, ptr %4, align 4
101 store i32 5, ptr %5, align 4
102 store i32 6, ptr %6, align 4
108 %0 = alloca i32, align 4
109 %1 = alloca i32, align 4
110 %2 = alloca i32, align 4
111 %3 = alloca i32, align 4
112 %4 = alloca i32, align 4
113 %5 = alloca i32, align 4
114 store i32 6, ptr %0, align 4
115 store i32 1, ptr %1, align 4
116 store i32 2, ptr %2, align 4
117 store i32 3, ptr %3, align 4
118 store i32 4, ptr %4, align 4
119 store i32 5, ptr %5, align 4
125 %0 = alloca i32, align 4
126 %1 = alloca i32, align 4
127 %2 = alloca i32, align 4
128 %3 = alloca i32, align 4
129 %4 = alloca i32, align 4
130 %5 = alloca i32, align 4
131 store i32 6, ptr %0, align 4
132 store i32 1, ptr %1, align 4
133 store i32 2, ptr %2, align 4
134 store i32 3, ptr %3, align 4
135 store i32 4, ptr %4, align 4
136 store i32 5, ptr %5, align 4
139 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: