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