brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · f54a622 Raw
45 lines · c
1// RUN: %clang_cc1 -O3 -triple x86_64-unknown-linux-gnu -target-cpu x86-64 %s -o %t -opt-record-file %t.yaml -emit-obj2// RUN: cat %t.yaml | FileCheck %s3// RUN: llvm-profdata merge %S/Inputs/opt-record.proftext -o %t.profdata4// RUN: %clang_cc1 -O3 -triple x86_64-unknown-linux-gnu -target-cpu x86-64 -fprofile-instrument-use=clang -fprofile-instrument-use-path=%t.profdata %s -o %t -opt-record-file %t.yaml -emit-obj5// RUN: cat %t.yaml | FileCheck -check-prefix=CHECK -check-prefix=CHECK-PGO %s6// RUN: %clang_cc1 -O3 -triple x86_64-unknown-linux-gnu -target-cpu x86-64 %s -o %t -opt-record-file %t.yaml -opt-record-passes inline -emit-obj7// RUN: cat %t.yaml | FileCheck -check-prefix=CHECK-PASSES %s8// RUN: not %clang_cc1 -O3 -triple x86_64-unknown-linux-gnu -target-cpu x86-64 %s -o %t -opt-record-file %t.yaml -opt-record-passes "(foo" -emit-obj 2>&1 | FileCheck -check-prefix=CHECK-PATTERN-ERROR %s9// RUN: %clang_cc1 -O3 -triple x86_64-unknown-linux-gnu -target-cpu x86-64 %s -o %t -opt-record-file %t.yaml -opt-record-format yaml -emit-obj10// RUN: cat %t.yaml | FileCheck %s11// RUN: not %clang_cc1 -O3 -triple x86_64-unknown-linux-gnu -target-cpu x86-64 %s -o %t -opt-record-file %t.yaml -opt-record-format "unknown-format" -emit-obj 2>&1 | FileCheck -check-prefix=CHECK-FORMAT-ERROR %s12// REQUIRES: x86-registered-target13 14void bar(void);15void foo(void) { bar(); }16 17void Test(int *res, int *c, int *d, int *p, int n) {18  int i;19 20#pragma clang loop vectorize(assume_safety)21  for (i = 0; i < 1600; i++) {22    res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];23  }24}25 26// CHECK: --- !Missed27// CHECK: Pass:            inline28// CHECK: Name:            NoDefinition29// CHECK: DebugLoc:30// CHECK: Function:        foo31// CHECK-PGO: Hotness:32// CHECK-PASSES: Pass: inline33 34// CHECK: --- !Passed35// CHECK: Pass:            loop-vectorize36// CHECK: Name:            Vectorized37// CHECK: DebugLoc:38// CHECK: Function:        Test39// CHECK-PGO: Hotness:40// CHECK-PASSES-NOT: loop-vectorize41 42// CHECK-PATTERN-ERROR: error: in pattern '(foo': parentheses not balanced43 44// CHECK-FORMAT-ERROR: error: unknown remark serializer format: 'unknown-format'45