diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2010-09-17 15:54:40 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2010-09-17 15:54:40 +0000 |
commit | 3d1dcd9bfdb15c49ee34d576a065079ac5c4d29f (patch) | |
tree | 0bbe07708f7571f8b5291f6d7b96c102b7c99dee /test/Sema/builtins.c | |
parent | a0482fa4e7fa27b01184f938097f0666b78016dd (diff) |
Notes
Diffstat (limited to 'test/Sema/builtins.c')
-rw-r--r-- | test/Sema/builtins.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/Sema/builtins.c b/test/Sema/builtins.c index c0a2131868e48..787630c1a8c4e 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) { + } } @@ -75,3 +80,18 @@ void test12(void) { void test_unknown_builtin(int a, int b) { __builtin_foo(a, b); // expected-error{{use of unknown builtin}} } + +int test13() { + __builtin_eh_return(0, 0); // no warning, eh_return never returns. +} + +// <rdar://problem/8228293> +void test14() { + int old; + old = __sync_fetch_and_min((volatile int *)&old, 1); +} + +// <rdar://problem/8336581> +void test15(const char *s) { + __builtin_printf("string is %s\n", s); +} |