aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/builtins.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/builtins.c')
-rw-r--r--test/Sema/builtins.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/Sema/builtins.c b/test/Sema/builtins.c
index c0a2131868..64a4b30492 100644
--- a/test/Sema/builtins.c
+++ b/test/Sema/builtins.c
@@ -44,6 +44,11 @@ void test9(short v) {
// PR7600: Pointers are implicitly casted to integers and back.
void *old_ptr = __sync_val_compare_and_swap((void**)0, 0, 0);
+
+ // Ensure the return type is correct even when implicit casts are stripped
+ // away. This triggers an assertion while checking the comparison otherwise.
+ if (__sync_fetch_and_add(&old, 1) == 1) {
+ }
}