2017-10-19 02:10:13 +08:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Tests for the hvx features and warnings.
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
2018-12-06 05:38:35 +08:00
|
|
|
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv66 -mhvx \
|
|
|
|
// RUN: 2>&1 | FileCheck -check-prefix=CHECKHVX166 %s
|
|
|
|
// CHECKHVX166: "-target-feature" "+hvxv66"
|
|
|
|
|
2017-12-13 21:48:07 +08:00
|
|
|
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv65 -mhvx \
|
|
|
|
// RUN: 2>&1 | FileCheck -check-prefix=CHECKHVX165 %s
|
|
|
|
// CHECKHVX165: "-target-feature" "+hvxv65"
|
|
|
|
|
2017-10-19 02:10:13 +08:00
|
|
|
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mhvx \
|
|
|
|
// RUN: 2>&1 | FileCheck -check-prefix=CHECKHVX162 %s
|
|
|
|
// CHECKHVX162: "-target-feature" "+hvxv62"
|
|
|
|
|
2017-12-13 21:48:07 +08:00
|
|
|
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv65 -mhvx \
|
|
|
|
// RUN: -mhvx-length=128B 2>&1 | FileCheck -check-prefix=CHECKHVX2 %s
|
|
|
|
|
2017-10-19 02:10:13 +08:00
|
|
|
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mhvx \
|
|
|
|
// RUN: -mhvx-length=128B 2>&1 | FileCheck -check-prefix=CHECKHVX2 %s
|
2018-01-25 02:42:19 +08:00
|
|
|
|
|
|
|
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mhvx \
|
|
|
|
// RUN: -mhvx-length=128b 2>&1 | FileCheck -check-prefix=CHECKHVX2 %s
|
2017-10-19 02:10:13 +08:00
|
|
|
// CHECKHVX2-NOT: "-target-feature" "+hvx-length64b"
|
|
|
|
// CHECKHVX2: "-target-feature" "+hvx-length128b"
|
|
|
|
|
2017-12-13 21:48:07 +08:00
|
|
|
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv65 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=CHECKHVX3 %s
|
|
|
|
|
2017-10-19 02:10:13 +08:00
|
|
|
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=CHECKHVX3 %s
|
|
|
|
// CHECKHVX3-NOT: "-target-feature" "+hvx
|
|
|
|
|
2018-04-03 23:59:10 +08:00
|
|
|
// No hvx target feature must be added if -mno-hvx occurs last
|
2017-10-19 02:10:13 +08:00
|
|
|
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mno-hvx \
|
|
|
|
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-NOHVX %s
|
|
|
|
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mhvx -mno-hvx \
|
|
|
|
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-NOHVX %s
|
|
|
|
// CHECK-NOHVX-NOT: "-target-feature" "+hvx
|
|
|
|
|
2018-04-06 23:14:32 +08:00
|
|
|
// Hvx target feature should be added if -mno-hvx doesn't occur last
|
2017-10-19 02:10:13 +08:00
|
|
|
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mno-hvx -mhvx\
|
|
|
|
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXFEAT %s
|
|
|
|
// CHECK-HVXFEAT: "-target-feature" "+hvxv62"
|
|
|
|
|
|
|
|
// With -mhvx, the version of hvx defaults to Cpu
|
|
|
|
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv60 -mhvx \
|
|
|
|
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVX-DEFAULT %s
|
|
|
|
// CHECK-HVX-DEFAULT: "-target-feature" "+hvxv60"
|
|
|
|
|
|
|
|
// Test -mhvx= flag
|
|
|
|
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv60 -mhvx=v62 \
|
|
|
|
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXEQ %s
|
|
|
|
// CHECK-HVXEQ: "-target-feature" "+hvxv62"
|
|
|
|
|
2018-01-24 18:26:09 +08:00
|
|
|
// Honor the last occurred -mhvx=, -mhvx flag.
|
2017-10-19 02:10:13 +08:00
|
|
|
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv60 -mhvx=v62 -mhvx\
|
|
|
|
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXEQ-PRE %s
|
|
|
|
// CHECK-HVXEQ-PRE-NOT: "-target-feature" "+hvxv62"
|
|
|
|
// CHECK-HVXEQ-PRE: "-target-feature" "+hvxv60"
|
|
|
|
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv60 -mhvx -mhvx=v62\
|
|
|
|
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXEQ-PRE2 %s
|
|
|
|
// CHECK-HVXEQ-PRE2-NOT: "-target-feature" "+hvxv60"
|
|
|
|
// CHECK-HVXEQ-PRE2: "-target-feature" "+hvxv62"
|
|
|
|
|
|
|
|
// Test -mhvx-length flag
|
|
|
|
// The default mode on v60,v62 is 64B.
|
|
|
|
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv60 -mhvx \
|
|
|
|
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-64B %s
|
2018-01-25 02:42:19 +08:00
|
|
|
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv60 -mhvx \
|
|
|
|
// RUN: -mhvx-length=64b 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-64B %s
|
|
|
|
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv60 -mhvx \
|
|
|
|
// RUN: -mhvx-length=64B 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-64B %s
|
2017-10-19 02:10:13 +08:00
|
|
|
// CHECK-HVXLENGTH-64B: "-target-feature" "+hvx{{.*}}" "-target-feature" "+hvx-length64b"
|
2018-12-06 05:38:35 +08:00
|
|
|
// The default mode on v66 and future archs is 128B.
|
|
|
|
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv66 -mhvx \
|
|
|
|
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-128B %s
|
2017-10-19 02:10:13 +08:00
|
|
|
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mhvx -mhvx-length=128B\
|
|
|
|
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-128B %s
|
|
|
|
// CHECK-HVXLENGTH-128B: "-target-feature" "+hvx{{.*}}" "-target-feature" "+hvx-length128b"
|
|
|
|
|
|
|
|
// Bail out if -mhvx-length is specified without HVX enabled
|
|
|
|
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mhvx-length=64B \
|
|
|
|
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-ERROR %s
|
|
|
|
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mhvx-length=128B \
|
|
|
|
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-ERROR %s
|
|
|
|
// CHECK-HVXLENGTH-ERROR: error: -mhvx-length is not supported without a -mhvx/-mhvx= flag
|
|
|
|
|
|
|
|
// Error out if an unsupported value is passed to -mhvx-length.
|
|
|
|
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mhvx -mhvx-length=B \
|
|
|
|
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-VALUE-ERROR %s
|
|
|
|
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mhvx -mhvx-length=128 \
|
|
|
|
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-VALUE-ERROR %s
|
|
|
|
// CHECK-HVXLENGTH-VALUE-ERROR: error: unsupported argument '{{.*}}' to option 'mhvx-length='
|