blob: 9ccedd2ce89487632c62d2409c97a346cb2a1966 [file] [log] [blame]
Nemanja Ivanovic239eec72015-04-09 23:58:16 +00001// REQUIRES: powerpc-registered-target
2// RUN: not %clang_cc1 -triple powerpc64-unknown-unknown \
3// RUN: -target-cpu pwr6 -emit-llvm %s -o - 2>&1 \
4// RUN: | FileCheck %s
5
6// RUN: not %clang_cc1 -triple powerpc-unknown-unknown -emit-llvm %s -o - 2>&1 \
7// RUN: -target-cpu pwr7 | FileCheck %s -check-prefix=CHECK-32
8
9void call_p7_builtins(void)
10{
11 int a = __builtin_divwe(33, 11);
12 unsigned int b = __builtin_divweu(33U, 11U);
13 unsigned long long d = __builtin_divde(33ULL, 11ULL);
14 unsigned long long e = __builtin_divdeu(33ULL, 11ULL);
15 unsigned long long f = __builtin_bpermd(33ULL, 11ULL);
16}
17
18// CHECK: error: this builtin is only valid on POWER7 or later CPUs
19// CHECK: __builtin_divwe
20// CHECK: error: this builtin is only valid on POWER7 or later CPUs
21// CHECK: __builtin_divweu
22// CHECK: error: this builtin is only valid on POWER7 or later CPUs
23// CHECK: __builtin_divde
24// CHECK: error: this builtin is only valid on POWER7 or later CPUs
25// CHECK: __builtin_divdeu
26// CHECK: error: this builtin is only valid on POWER7 or later CPUs
27// CHECK: __builtin_bpermd
28// CHECK-32: error: this builtin is only available on 64-bit targets
29// CHECK-32: __builtin_divde
30// CHECK-32: error: this builtin is only available on 64-bit targets
31// CHECK-32: __builtin_divdeu
32// CHECK-32: error: this builtin is only available on 64-bit targets
33// CHECK-32: __builtin_bpermd