Debian Codegraph @

clang/test/CodeGen/PowerPC/builtins-amo-err.c

raw
1 // RUN: not %clang_cc1 -triple powerpc-ibm-aix -target-cpu pwr9 \
2 // RUN: -emit-llvm %s -o - 2>&1 | FileCheck %s --check-prefix=AIX32-ERROR
3 // RUN: not %clang_cc1 -triple powerpc64-ibm-aix -target-cpu pwr9 \
4 // RUN: -emit-llvm %s -o - 2>&1 | FileCheck %s --check-prefix=FC-ERROR
5
6 void test_amo() {
7 unsigned int *ptr1, value1;
8 // AIX32-ERROR-COUNT-2: error: this builtin is only available on 64-bit targets
9 __builtin_amo_lwat(ptr1, value1, 0);
10 // FC-ERROR: argument value 9 is outside the valid range [0-4, 6, 8]
11 __builtin_amo_lwat(ptr1, value1, 9);
12
13 unsigned long int *ptr2, value2;
14 // AIX32-ERROR-COUNT-2: error: this builtin is only available on 64-bit targets
15 __builtin_amo_ldat(ptr2, value2, 3);
16 // FC-ERROR: error: argument value 26 is outside the valid range [0-4, 6, 8]
17 __builtin_amo_ldat(ptr2, value2, 26);
18
19 signed int *ptr3, value3;
20 // AIX32-ERROR-COUNT-2: error: this builtin is only available on 64-bit targets
21 __builtin_amo_lwat_s(ptr3, value3, 0);
22 // FC-ERROR: argument value 2 is outside the valid range [0, 5, 7, 8]
23 __builtin_amo_lwat_s(ptr3, value3, 2);
24
25 signed long int *ptr4, value4;
26 // AIX32-ERROR-COUNT-2: error: this builtin is only available on 64-bit targets
27 __builtin_amo_ldat_s(ptr4, value4, 5);
28 // FC-ERROR: error: argument value 6 is outside the valid range [0, 5, 7, 8]
29 __builtin_amo_ldat_s(ptr4, value4, 6);
30 }