blob: ebe2123a2fc40142eea1b055611973bd966eeed5 [file] [log] [blame]
Richard Smith0015f092013-01-17 22:16:11 +00001// RUN: %clang -fsyntax-only -Xclang -verify -std=c11 %s
Richard Smith584f7dc2013-04-04 02:55:24 +00002// RUN: %clang -fsyntax-only -Xclang -verify -std=c11 -fmodules %s
Daniel Dunbar50b8b552013-04-12 23:41:08 +00003// RUN: %clang -fsyntax-only -Xclang -verify -std=c11 -ffreestanding %s
Richard Smith0015f092013-01-17 22:16:11 +00004
5noreturn int f(); // expected-error 1+{{}}
6
7#include <stdnoreturn.h>
8#include <stdnoreturn.h>
9#include <stdnoreturn.h>
10
11int g();
12noreturn int g();
13int noreturn g();
14int g();
Richard Smith4dab7092013-01-30 06:33:54 +000015
16#include <stdalign.h>
17_Static_assert(__alignas_is_defined, "");
18_Static_assert(__alignof_is_defined, "");
19alignas(alignof(int)) char c[4];
20_Static_assert(__alignof(c) == 4, "");
Daniel Dunbar95f1de32013-04-12 23:24:56 +000021
22#define __STDC_WANT_LIB_EXT1__ 1
23#include <stddef.h>
24#include <stdint.h>
Daniel Dunbar50b8b552013-04-12 23:41:08 +000025rsize_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__
30rsize_t x2 = RSIZE_MAX;
31#endif
32