| Richard Smith | 0015f09 | 2013-01-17 22:16:11 +0000 | [diff] [blame] | 1 | // RUN: %clang -fsyntax-only -Xclang -verify -std=c11 %s | 
| Richard Smith | 584f7dc | 2013-04-04 02:55:24 +0000 | [diff] [blame] | 2 | // RUN: %clang -fsyntax-only -Xclang -verify -std=c11 -fmodules %s | 
| Daniel Dunbar | 50b8b55 | 2013-04-12 23:41:08 +0000 | [diff] [blame] | 3 | // RUN: %clang -fsyntax-only -Xclang -verify -std=c11 -ffreestanding %s | 
| Richard Smith | 0015f09 | 2013-01-17 22:16:11 +0000 | [diff] [blame] | 4 |  | 
|  | 5 | noreturn int f(); // expected-error 1+{{}} | 
|  | 6 |  | 
|  | 7 | #include <stdnoreturn.h> | 
|  | 8 | #include <stdnoreturn.h> | 
|  | 9 | #include <stdnoreturn.h> | 
|  | 10 |  | 
|  | 11 | int g(); | 
|  | 12 | noreturn int g(); | 
|  | 13 | int noreturn g(); | 
|  | 14 | int g(); | 
| Richard Smith | 4dab709 | 2013-01-30 06:33:54 +0000 | [diff] [blame] | 15 |  | 
|  | 16 | #include <stdalign.h> | 
|  | 17 | _Static_assert(__alignas_is_defined, ""); | 
|  | 18 | _Static_assert(__alignof_is_defined, ""); | 
|  | 19 | alignas(alignof(int)) char c[4]; | 
|  | 20 | _Static_assert(__alignof(c) == 4, ""); | 
| Daniel Dunbar | 95f1de3 | 2013-04-12 23:24:56 +0000 | [diff] [blame] | 21 |  | 
|  | 22 | #define __STDC_WANT_LIB_EXT1__ 1 | 
|  | 23 | #include <stddef.h> | 
|  | 24 | #include <stdint.h> | 
| Daniel Dunbar | 50b8b55 | 2013-04-12 23:41:08 +0000 | [diff] [blame] | 25 | rsize_t x = 0; | 
|  | 26 |  | 
|  | 27 | // If we are freestanding, then also check RSIZE_MAX (in a hosted implementation | 
|  | 28 | // we will use the host stdint.h, which may not yet have C11 support). | 
|  | 29 | #ifndef __STDC_HOSTED__ | 
|  | 30 | rsize_t x2 = RSIZE_MAX; | 
|  | 31 | #endif | 
|  | 32 |  |