| Ben Langmuir | 101390e | 2014-03-10 23:17:14 +0000 | [diff] [blame] | 1 | // RUN: rm -rf %t | 
| Chandler Carruth | 2c93cb2 | 2013-09-20 21:12:25 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -fsyntax-only -verify -std=c11 %s | 
| Ben Langmuir | 101390e | 2014-03-10 23:17:14 +0000 | [diff] [blame] | 3 | // RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -fmodules -fmodules-cache-path=%t %s | 
| Chandler Carruth | 2c93cb2 | 2013-09-20 21:12:25 +0000 | [diff] [blame] | 4 | // RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -ffreestanding %s | 
| Saleem Abdulrasool | c68237b | 2014-07-16 03:13:50 +0000 | [diff] [blame^] | 5 | // RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -triple i686-pc-win32 -fms-compatibility-version=17.00 %s | 
| Richard Smith | 0015f09 | 2013-01-17 22:16:11 +0000 | [diff] [blame] | 6 |  | 
|  | 7 | noreturn int f(); // expected-error 1+{{}} | 
|  | 8 |  | 
|  | 9 | #include <stdnoreturn.h> | 
|  | 10 | #include <stdnoreturn.h> | 
|  | 11 | #include <stdnoreturn.h> | 
|  | 12 |  | 
|  | 13 | int g(); | 
|  | 14 | noreturn int g(); | 
|  | 15 | int noreturn g(); | 
|  | 16 | int g(); | 
| Richard Smith | 4dab709 | 2013-01-30 06:33:54 +0000 | [diff] [blame] | 17 |  | 
|  | 18 | #include <stdalign.h> | 
|  | 19 | _Static_assert(__alignas_is_defined, ""); | 
|  | 20 | _Static_assert(__alignof_is_defined, ""); | 
|  | 21 | alignas(alignof(int)) char c[4]; | 
|  | 22 | _Static_assert(__alignof(c) == 4, ""); | 
| Daniel Dunbar | 95f1de3 | 2013-04-12 23:24:56 +0000 | [diff] [blame] | 23 |  | 
|  | 24 | #define __STDC_WANT_LIB_EXT1__ 1 | 
|  | 25 | #include <stddef.h> | 
| Daniel Dunbar | 50b8b55 | 2013-04-12 23:41:08 +0000 | [diff] [blame] | 26 | rsize_t x = 0; | 
| Chandler Carruth | e813984 | 2014-02-19 22:35:01 +0000 | [diff] [blame] | 27 | _Static_assert(sizeof(max_align_t) >= sizeof(long long), ""); | 
|  | 28 | _Static_assert(alignof(max_align_t) >= alignof(long long), ""); | 
|  | 29 | _Static_assert(sizeof(max_align_t) >= sizeof(long double), ""); | 
|  | 30 | _Static_assert(alignof(max_align_t) >= alignof(long double), ""); | 
| Daniel Dunbar | 50b8b55 | 2013-04-12 23:41:08 +0000 | [diff] [blame] | 31 |  | 
| David Majnemer | 1e57976 | 2014-03-04 23:43:48 +0000 | [diff] [blame] | 32 | #ifdef _MSC_VER | 
|  | 33 | _Static_assert(sizeof(max_align_t) == sizeof(double), ""); | 
|  | 34 | #endif | 
|  | 35 |  | 
| Daniel Dunbar | 50b8b55 | 2013-04-12 23:41:08 +0000 | [diff] [blame] | 36 | // If we are freestanding, then also check RSIZE_MAX (in a hosted implementation | 
|  | 37 | // we will use the host stdint.h, which may not yet have C11 support). | 
|  | 38 | #ifndef __STDC_HOSTED__ | 
| Daniel Dunbar | 893f3d5 | 2013-04-17 21:11:07 +0000 | [diff] [blame] | 39 | #include <stdint.h> | 
| Daniel Dunbar | 50b8b55 | 2013-04-12 23:41:08 +0000 | [diff] [blame] | 40 | rsize_t x2 = RSIZE_MAX; | 
|  | 41 | #endif | 
|  | 42 |  |