2014-03-11 07:17:14 +08:00
|
|
|
// RUN: rm -rf %t
|
2013-09-21 05:12:25 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify -std=c11 %s
|
2014-10-03 08:31:35 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -fmodules -fmodules-cache-path=%t %s -D__STDC_WANT_LIB_EXT1__=1
|
2013-09-21 05:12:25 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -ffreestanding %s
|
2019-05-09 06:01:20 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -triple i686-pc-win32 -fms-compatibility-version=17.00 %s
|
2013-01-18 06:16:11 +08:00
|
|
|
|
|
|
|
noreturn int f(); // expected-error 1+{{}}
|
|
|
|
|
|
|
|
#include <stdnoreturn.h>
|
|
|
|
#include <stdnoreturn.h>
|
|
|
|
#include <stdnoreturn.h>
|
|
|
|
|
|
|
|
int g();
|
|
|
|
noreturn int g();
|
|
|
|
int noreturn g();
|
|
|
|
int g();
|
2013-01-30 14:33:54 +08:00
|
|
|
|
|
|
|
#include <stdalign.h>
|
|
|
|
_Static_assert(__alignas_is_defined, "");
|
|
|
|
_Static_assert(__alignof_is_defined, "");
|
|
|
|
alignas(alignof(int)) char c[4];
|
|
|
|
_Static_assert(__alignof(c) == 4, "");
|
2013-04-13 07:24:56 +08:00
|
|
|
|
|
|
|
#define __STDC_WANT_LIB_EXT1__ 1
|
|
|
|
#include <stddef.h>
|
2013-04-13 07:41:08 +08:00
|
|
|
rsize_t x = 0;
|
2014-02-20 06:35:01 +08:00
|
|
|
_Static_assert(sizeof(max_align_t) >= sizeof(long long), "");
|
|
|
|
_Static_assert(alignof(max_align_t) >= alignof(long long), "");
|
|
|
|
_Static_assert(sizeof(max_align_t) >= sizeof(long double), "");
|
|
|
|
_Static_assert(alignof(max_align_t) >= alignof(long double), "");
|
2013-04-13 07:41:08 +08:00
|
|
|
|
2014-03-05 07:43:48 +08:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
_Static_assert(sizeof(max_align_t) == sizeof(double), "");
|
|
|
|
#endif
|
|
|
|
|
2013-04-13 07:41:08 +08:00
|
|
|
// If we are freestanding, then also check RSIZE_MAX (in a hosted implementation
|
|
|
|
// we will use the host stdint.h, which may not yet have C11 support).
|
|
|
|
#ifndef __STDC_HOSTED__
|
2013-04-18 05:11:07 +08:00
|
|
|
#include <stdint.h>
|
2013-04-13 07:41:08 +08:00
|
|
|
rsize_t x2 = RSIZE_MAX;
|
|
|
|
#endif
|
|
|
|
|