diff --git a/clang/include/clang/Basic/BuiltinsPPC.def b/clang/include/clang/Basic/BuiltinsPPC.def --- a/clang/include/clang/Basic/BuiltinsPPC.def +++ b/clang/include/clang/Basic/BuiltinsPPC.def @@ -64,8 +64,8 @@ BUILTIN(__builtin_ppc_fsqrts, "ff", "") BUILTIN(__builtin_ppc_compare_and_swap, "iiD*i*i", "") BUILTIN(__builtin_ppc_compare_and_swaplp, "iLiD*Li*Li", "") -BUILTIN(__builtin_ppc_fetch_and_add, "UiUiD*Ui", "") -BUILTIN(__builtin_ppc_fetch_and_addlp, "ULiULiD*ULi", "") +BUILTIN(__builtin_ppc_fetch_and_add, "iiD*i", "") +BUILTIN(__builtin_ppc_fetch_and_addlp, "LiLiD*Li", "") BUILTIN(__builtin_ppc_fetch_and_and, "UiUiD*Ui", "") BUILTIN(__builtin_ppc_fetch_and_andlp, "ULiULiD*ULi", "") BUILTIN(__builtin_ppc_fetch_and_or, "UiUiD*Ui", "") diff --git a/clang/test/CodeGen/builtins-ppc-xlcompat-fetch-error.c b/clang/test/CodeGen/builtins-ppc-xlcompat-fetch-error.c --- a/clang/test/CodeGen/builtins-ppc-xlcompat-fetch-error.c +++ b/clang/test/CodeGen/builtins-ppc-xlcompat-fetch-error.c @@ -1,17 +1,18 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py // REQUIRES: powerpc-registered-target // RUN: %clang_cc1 -triple powerpc64-unknown-aix -target-cpu pwr8 \ // RUN: -verify %s void test_builtin_ppc_fetch_and_add2() { - volatile int a = 0; + volatile unsigned int a = 0; unsigned int b = 0; - __fetch_and_add(&a, b); // expected-warning {{passing 'volatile int *' to parameter of type 'volatile unsigned int *' converts between pointers to integer types with different sign}} + __fetch_and_add(&a, b); // expected-warning {{passing 'volatile unsigned int *' to parameter of type 'volatile int *' converts between pointers to integer types with different sign}} } void test_builtin_ppc_fetch_and_addlp() { - volatile long a = 0; + volatile unsigned long a = 0; unsigned long b = 0; - __fetch_and_addlp(&a, b); // expected-warning {{passing 'volatile long *' to parameter of type 'volatile unsigned long *' converts between pointers to integer types with different sign}} + __fetch_and_addlp(&a, b); // expected-warning {{passing 'volatile unsigned long *' to parameter of type 'volatile long *' converts between pointers to integer types with different sign}} } diff --git a/clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c b/clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c --- a/clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c +++ b/clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c @@ -16,7 +16,7 @@ // CHECK-NEXT: [[TMP2:%.*]] = atomicrmw add i32* [[A_ADDR]], i32 [[TMP1]] monotonic, align 4 // CHECK-NEXT: ret void // -void test_builtin_ppc_fetch_and_add(unsigned int a, unsigned int b) { +void test_builtin_ppc_fetch_and_add(int a, int b) { __fetch_and_add(&a, b); } @@ -31,7 +31,7 @@ // CHECK-NEXT: [[TMP2:%.*]] = atomicrmw add i64* [[A_ADDR]], i64 [[TMP1]] monotonic, align 8 // CHECK-NEXT: ret void // -void test_builtin_ppc_fetch_and_addlp(unsigned long a, unsigned long b) { +void test_builtin_ppc_fetch_and_addlp(long a, long b) { __fetch_and_addlp(&a, b); } // CHECK-LABEL: @test_builtin_ppc_fetch_and_and(