blob: f1ae92af1a4ab14242a02947d0ac1fd1723b40cb [file] [log] [blame]
Nemanja Ivanovic26c35342015-07-10 13:11:34 +00001// REQUIRES: powerpc-registered-target
2// RUN: not %clang -fsyntax-only -mcpu=power8 -std=c++11 %s 2>&1 | \
3// RUN: FileCheck %s -check-prefix=CHECK-DEFAULT
4
5// RUN: not %clang -fsyntax-only -mcpu=power8 -std=c++11 \
6// RUN: -mno-vsx -mpower8-vector %s 2>&1 | FileCheck %s \
7// RUN: -check-prefix=CHECK-NVSX-P8V
8
9// RUN: not %clang -fsyntax-only -mcpu=power8 -std=c++11 \
10// RUN: -mno-vsx -mdirect-move %s 2>&1 | FileCheck %s \
11// RUN: -check-prefix=CHECK-NVSX-DMV
12
13// RUN: not %clang -fsyntax-only -mcpu=power8 -std=c++11 \
14// RUN: -mno-vsx -mpower8-vector -mvsx %s 2>&1 | FileCheck %s \
15// RUN: -check-prefix=CHECK-DEFAULT
16
17// RUN: not %clang -fsyntax-only -mcpu=power8 -std=c++11 \
18// RUN: -mno-vsx -mdirect-move -mvsx %s 2>&1 | FileCheck %s \
19// RUN: -check-prefix=CHECK-DEFAULT
20
21// RUN: not %clang -fsyntax-only -mcpu=power8 -std=c++11 \
22// RUN: -mpower8-vector -mno-vsx %s 2>&1 | FileCheck %s \
23// RUN: -check-prefix=CHECK-NVSX-P8V
24
25// RUN: not %clang -fsyntax-only -mcpu=power8 -std=c++11 \
26// RUN: -mdirect-move -mno-vsx %s 2>&1 | FileCheck %s \
27// RUN: -check-prefix=CHECK-NVSX-DMV
28
29// RUN: not %clang -fsyntax-only -mcpu=power8 -std=c++11 \
30// RUN: -mno-vsx %s 2>&1 | FileCheck %s \
31// RUN: -check-prefix=CHECK-NVSX
32
33// RUN: not %clang -fsyntax-only -mcpu=power6 -std=c++11 %s 2>&1 | \
34// RUN: FileCheck %s -check-prefix=CHECK-NVSX
35
36// RUN: not %clang -fsyntax-only -mcpu=power6 -std=c++11 \
37// RUN: -mpower8-vector %s 2>&1 | FileCheck %s \
38// RUN: -check-prefix=CHECK-DEFAULT
39
40// RUN: not %clang -fsyntax-only -mcpu=power6 -std=c++11 \
41// RUN: -mdirect-move %s 2>&1 | FileCheck %s \
42// RUN: -check-prefix=CHECK-VSX
43
44#ifdef __VSX__
45static_assert(false, "VSX enabled");
46#endif
47
48#ifdef __POWER8_VECTOR__
49static_assert(false, "P8V enabled");
50#endif
51
52#if !defined(__VSX__) && !defined(__POWER8_VECTOR__)
53static_assert(false, "Neither enabled");
54#endif
55
56// CHECK-DEFAULT: VSX enabled
57// CHECK-DEFAULT: P8V enabled
58// CHECK-NVSX-P8V: error: option '-mpower8-vector' cannot be specified with '-mno-vsx'
59// CHECK-NVSX-DMV: error: option '-mdirect-move' cannot be specified with '-mno-vsx'
60// CHECK-NVSX: Neither enabled
61// CHECK-VSX: VSX enabled