2016-10-11 08:26:09 +08:00
|
|
|
// RUN: %clang_cc1 -O3 -triple x86_64-unknown-linux-gnu -target-cpu x86-64 %s -o %t -dwarf-column-info -opt-record-file %t.yaml -emit-obj
|
|
|
|
// RUN: cat %t.yaml | FileCheck %s
|
|
|
|
// RUN: llvm-profdata merge %S/Inputs/opt-record.proftext -o %t.profdata
|
|
|
|
// RUN: %clang_cc1 -O3 -triple x86_64-unknown-linux-gnu -target-cpu x86-64 -fprofile-instrument-use-path=%t.profdata %s -o %t -dwarf-column-info -opt-record-file %t.yaml -emit-obj
|
|
|
|
// RUN: cat %t.yaml | FileCheck -check-prefix=CHECK -check-prefix=CHECK-PGO %s
|
2019-03-13 05:22:27 +08:00
|
|
|
// RUN: %clang_cc1 -O3 -triple x86_64-unknown-linux-gnu -target-cpu x86-64 %s -o %t -dwarf-column-info -opt-record-file %t.yaml -opt-record-passes inline -emit-obj
|
|
|
|
// RUN: cat %t.yaml | FileCheck -check-prefix=CHECK-PASSES %s
|
2019-06-15 05:38:57 +08:00
|
|
|
// RUN: not %clang_cc1 -O3 -triple x86_64-unknown-linux-gnu -target-cpu x86-64 %s -o %t -dwarf-column-info -opt-record-file %t.yaml -opt-record-passes "(foo" -emit-obj 2>&1 | FileCheck -check-prefix=CHECK-PATTERN-ERROR %s
|
2019-06-18 00:06:00 +08:00
|
|
|
// RUN: %clang_cc1 -O3 -triple x86_64-unknown-linux-gnu -target-cpu x86-64 %s -o %t -dwarf-column-info -opt-record-file %t.yaml -opt-record-format yaml -emit-obj
|
|
|
|
// RUN: cat %t.yaml | FileCheck %s
|
|
|
|
// RUN: not %clang_cc1 -O3 -triple x86_64-unknown-linux-gnu -target-cpu x86-64 %s -o %t -dwarf-column-info -opt-record-file %t.yaml -opt-record-format "unknown-format" -emit-obj 2>&1 | FileCheck -check-prefix=CHECK-FORMAT-ERROR %s
|
2016-10-11 08:26:09 +08:00
|
|
|
// REQUIRES: x86-registered-target
|
|
|
|
|
|
|
|
void bar();
|
|
|
|
void foo() { bar(); }
|
|
|
|
|
|
|
|
void Test(int *res, int *c, int *d, int *p, int n) {
|
|
|
|
int i;
|
|
|
|
|
|
|
|
#pragma clang loop vectorize(assume_safety)
|
|
|
|
for (i = 0; i < 1600; i++) {
|
|
|
|
res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK: --- !Missed
|
|
|
|
// CHECK: Pass: inline
|
|
|
|
// CHECK: Name: NoDefinition
|
|
|
|
// CHECK: DebugLoc:
|
|
|
|
// CHECK: Function: foo
|
|
|
|
// CHECK-PGO: Hotness:
|
2019-03-13 05:22:27 +08:00
|
|
|
// CHECK-PASSES: Pass: inline
|
2016-10-11 08:26:09 +08:00
|
|
|
|
|
|
|
// CHECK: --- !Passed
|
|
|
|
// CHECK: Pass: loop-vectorize
|
|
|
|
// CHECK: Name: Vectorized
|
|
|
|
// CHECK: DebugLoc:
|
|
|
|
// CHECK: Function: Test
|
|
|
|
// CHECK-PGO: Hotness:
|
2019-03-13 05:22:27 +08:00
|
|
|
// CHECK-PASSES-NOT: loop-vectorize
|
2019-06-15 05:38:57 +08:00
|
|
|
|
|
|
|
// CHECK-PATTERN-ERROR: error: in pattern '(foo': parentheses not balanced
|
2019-06-18 00:06:00 +08:00
|
|
|
|
|
|
|
// CHECK-FORMAT-ERROR: error: unknown remark serializer format: 'unknown-format'
|