llvm-project/llvm/test/tools/llvm-opt-report/basic.test

98 lines
4.2 KiB
Plaintext

RUN: llvm-opt-report -r %p %p/Inputs/or.yaml | FileCheck -strict-whitespace %s
RUN: llvm-opt-report -s -r %p %p/Inputs/or.yaml | FileCheck -strict-whitespace -check-prefix=CHECK-SUCCINCT %s
; CHECK: < {{.*}}/Inputs/or.c
; CHECK-NEXT: 2 | void bar();
; CHECK-NEXT: 3 | void foo() { bar(); }
; CHECK-NEXT: 4 |
; CHECK-NEXT: 5 | #include "or.h"
; CHECK-NEXT: 6 |
; CHECK-NEXT: 7 | void Test(int *res, int *c, int *d, int *p, int n) {
; CHECK-NEXT: 8 | int i;
; CHECK-NEXT: 9 |
; CHECK-NEXT: 10 | #pragma clang loop vectorize(assume_safety)
; CHECK-NEXT: 11 V4,2 | for (i = 0; i < 1600; i++) {
; CHECK-NEXT: 12 | res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
; CHECK-NEXT: 13 | }
; CHECK-NEXT: 14 |
; CHECK-NEXT: 15 U16 | for (i = 0; i < 16; i++) {
; CHECK-NEXT: 16 | res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
; CHECK-NEXT: 17 | }
; CHECK-NEXT: 18 |
; CHECK-NEXT: 19 I | foo();
; CHECK-NEXT: 20 |
; CHECK-NEXT: 21 | foo(); bar(); foo();
; CHECK-NEXT: I | ^
; CHECK-NEXT: I | ^
; CHECK-NEXT: 22 | }
; CHECK-NEXT: 23 |
; CHECK: < {{.*}}/Inputs/or.h
; CHECK-NEXT: 2 | void TestH(int *res, int *c, int *d, int *p, int n) {
; CHECK-NEXT: 3 | int i;
; CHECK-NEXT: 4 |
; CHECK-NEXT: 5 | #pragma clang loop vectorize(assume_safety)
; CHECK-NEXT: 6 V4,2 | for (i = 0; i < 1600; i++) {
; CHECK-NEXT: 7 | res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
; CHECK-NEXT: 8 | }
; CHECK-NEXT: 9 |
; CHECK-NEXT: 10 U16 | for (i = 0; i < 16; i++) {
; CHECK-NEXT: 11 | res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
; CHECK-NEXT: 12 | }
; CHECK-NEXT: 13 |
; CHECK-NEXT: 14 I | foo();
; CHECK-NEXT: 15 |
; CHECK-NEXT: 16 | foo(); bar(); foo();
; CHECK-NEXT: I | ^
; CHECK-NEXT: I | ^
; CHECK-NEXT: 17 | }
; CHECK-NEXT: 18 |
; CHECK-SUCCINCT: < {{.*}}/Inputs/or.c
CHECK-SUCCINCT-NEXT: 2 | void bar();
CHECK-SUCCINCT-NEXT: 3 | void foo() { bar(); }
CHECK-SUCCINCT-NEXT: 4 |
CHECK-SUCCINCT-NEXT: 5 | #include "or.h"
CHECK-SUCCINCT-NEXT: 6 |
CHECK-SUCCINCT-NEXT: 7 | void Test(int *res, int *c, int *d, int *p, int n) {
CHECK-SUCCINCT-NEXT: 8 | int i;
CHECK-SUCCINCT-NEXT: 9 |
CHECK-SUCCINCT-NEXT: 10 | #pragma clang loop vectorize(assume_safety)
CHECK-SUCCINCT-NEXT: 11 V | for (i = 0; i < 1600; i++) {
CHECK-SUCCINCT-NEXT: 12 | res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
CHECK-SUCCINCT-NEXT: 13 | }
CHECK-SUCCINCT-NEXT: 14 |
CHECK-SUCCINCT-NEXT: 15 U | for (i = 0; i < 16; i++) {
CHECK-SUCCINCT-NEXT: 16 | res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
CHECK-SUCCINCT-NEXT: 17 | }
CHECK-SUCCINCT-NEXT: 18 |
CHECK-SUCCINCT-NEXT: 19 I | foo();
CHECK-SUCCINCT-NEXT: 20 |
CHECK-SUCCINCT-NEXT: 21 | foo(); bar(); foo();
CHECK-SUCCINCT-NEXT: I | ^
CHECK-SUCCINCT-NEXT: I | ^
CHECK-SUCCINCT-NEXT: 22 | }
CHECK-SUCCINCT-NEXT: 23 |
CHECK-SUCCINCT: < {{.*}}/Inputs/or.h
CHECK-SUCCINCT-NEXT: 2 | void TestH(int *res, int *c, int *d, int *p, int n) {
CHECK-SUCCINCT-NEXT: 3 | int i;
CHECK-SUCCINCT-NEXT: 4 |
CHECK-SUCCINCT-NEXT: 5 | #pragma clang loop vectorize(assume_safety)
CHECK-SUCCINCT-NEXT: 6 V | for (i = 0; i < 1600; i++) {
CHECK-SUCCINCT-NEXT: 7 | res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
CHECK-SUCCINCT-NEXT: 8 | }
CHECK-SUCCINCT-NEXT: 9 |
CHECK-SUCCINCT-NEXT: 10 U | for (i = 0; i < 16; i++) {
CHECK-SUCCINCT-NEXT: 11 | res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
CHECK-SUCCINCT-NEXT: 12 | }
CHECK-SUCCINCT-NEXT: 13 |
CHECK-SUCCINCT-NEXT: 14 I | foo();
CHECK-SUCCINCT-NEXT: 15 |
CHECK-SUCCINCT-NEXT: 16 | foo(); bar(); foo();
CHECK-SUCCINCT-NEXT: I | ^
CHECK-SUCCINCT-NEXT: I | ^
CHECK-SUCCINCT-NEXT: 17 | }
CHECK-SUCCINCT-NEXT: 18 |