summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-10-20 23:26:58 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-10-20 23:26:58 +0000
commitab506adf7d3ced6abcaf42f92de3d6cd15fa19e8 (patch)
tree58e29f07d41e8ad46b8e282367d45b8dbf207a37 /clang/test
parente6b994eb93b6825d396e8ee66e791611ba112d25 (diff)
downloadbcm5719-llvm-ab506adf7d3ced6abcaf42f92de3d6cd15fa19e8.tar.gz
bcm5719-llvm-ab506adf7d3ced6abcaf42f92de3d6cd15fa19e8.zip
Switch C compilations to C11 by default.
This is long-since overdue, and matches GCC 5.0. This should also be backwards-compatible, because we already supported all of C11 as an extension in C99 mode. llvm-svn: 220244
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Lexer/has_extension.c4
-rw-r--r--clang/test/Lexer/has_feature_c1x.c10
-rw-r--r--clang/test/Parser/c11-noreturn.c2
-rw-r--r--clang/test/Parser/c1x-alignas.c2
-rw-r--r--clang/test/Preprocessor/init.c6
-rw-r--r--clang/test/Preprocessor/line-directive.c2
-rw-r--r--clang/test/Sema/anonymous-struct-union-c11.c4
-rw-r--r--clang/test/Sema/array-init.c4
-rw-r--r--clang/test/Sema/attr-deprecated.c4
-rw-r--r--clang/test/Sema/types.c8
10 files changed, 26 insertions, 20 deletions
diff --git a/clang/test/Lexer/has_extension.c b/clang/test/Lexer/has_extension.c
index 3b08510aa44..2ab3d1df37a 100644
--- a/clang/test/Lexer/has_extension.c
+++ b/clang/test/Lexer/has_extension.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-PED-NONE %s
-// RUN: %clang_cc1 -pedantic-errors -E %s -o - | FileCheck --check-prefix=CHECK-PED-ERR %s
+// RUN: %clang_cc1 -std=c99 -E %s -o - | FileCheck --check-prefix=CHECK-PED-NONE %s
+// RUN: %clang_cc1 -std=c99 -pedantic-errors -E %s -o - | FileCheck --check-prefix=CHECK-PED-ERR %s
// CHECK-PED-NONE: no_dummy_extension
#if !__has_extension(dummy_extension)
diff --git a/clang/test/Lexer/has_feature_c1x.c b/clang/test/Lexer/has_feature_c1x.c
index e26e309c037..cba329cfb55 100644
--- a/clang/test/Lexer/has_feature_c1x.c
+++ b/clang/test/Lexer/has_feature_c1x.c
@@ -1,5 +1,11 @@
-// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c1x %s -o - | FileCheck --check-prefix=CHECK-1X %s
-// RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-1X %s
+// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c89 %s -o - | FileCheck --check-prefix=CHECK-NO-1X %s
+// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=iso9899:199409 %s -o - | FileCheck --check-prefix=CHECK-NO-1X %s
+// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c99 %s -o - | FileCheck --check-prefix=CHECK-NO-1X %s
+// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c11 %s -o - | FileCheck --check-prefix=CHECK-1X %s
+//
+// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=gnu89 %s -o - | FileCheck --check-prefix=CHECK-NO-1X %s
+// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=gnu99 %s -o - | FileCheck --check-prefix=CHECK-NO-1X %s
+// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=gnu11 %s -o - | FileCheck --check-prefix=CHECK-1X %s
#if __has_feature(c_atomic)
int has_atomic();
diff --git a/clang/test/Parser/c11-noreturn.c b/clang/test/Parser/c11-noreturn.c
index e61901dfb79..6c01b5533ac 100644
--- a/clang/test/Parser/c11-noreturn.c
+++ b/clang/test/Parser/c11-noreturn.c
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -std=c11 -fsyntax-only -verify %s
-// RUN: not %clang_cc1 -pedantic -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-EXT %s
+// RUN: not %clang_cc1 -std=c99 -pedantic -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-EXT %s
_Noreturn int f();
int _Noreturn f(); // expected-note {{previous}}
diff --git a/clang/test/Parser/c1x-alignas.c b/clang/test/Parser/c1x-alignas.c
index 5b29df262d3..ce8436c12fb 100644
--- a/clang/test/Parser/c1x-alignas.c
+++ b/clang/test/Parser/c1x-alignas.c
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -std=c11 -fsyntax-only -verify %s
-// RUN: not %clang_cc1 -pedantic -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-EXT %s
+// RUN: not %clang_cc1 -std=c99 -pedantic -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-EXT %s
_Alignas(4) char c1;
unsigned _Alignas(long) char c2;
diff --git a/clang/test/Preprocessor/init.c b/clang/test/Preprocessor/init.c
index b45c2c944a1..1afdbcaaa94 100644
--- a/clang/test/Preprocessor/init.c
+++ b/clang/test/Preprocessor/init.c
@@ -80,7 +80,7 @@
// COMMON:#define __ORDER_LITTLE_ENDIAN__ 1234
// COMMON:#define __ORDER_PDP_ENDIAN__ 3412
// COMMON:#define __STDC_HOSTED__ 1
-// COMMON:#define __STDC_VERSION__
+// COMMON:#define __STDC_VERSION__ 201112L
// COMMON:#define __STDC__ 1
// COMMON:#define __VERSION__
// COMMON:#define __clang__ 1
@@ -2546,7 +2546,7 @@
// MIPS32BE:#define __SIZE_TYPE__ unsigned int
// MIPS32BE:#define __SIZE_WIDTH__ 32
// MIPS32BE:#define __STDC_HOSTED__ 0
-// MIPS32BE:#define __STDC_VERSION__ 199901L
+// MIPS32BE:#define __STDC_VERSION__ 201112L
// MIPS32BE:#define __STDC__ 1
// MIPS32BE:#define __UINT16_C_SUFFIX__ {{$}}
// MIPS32BE:#define __UINT16_MAX__ 65535
@@ -5458,7 +5458,7 @@
// PPC-DARWIN:#define __SIZE_TYPE__ long unsigned int
// PPC-DARWIN:#define __SIZE_WIDTH__ 32
// PPC-DARWIN:#define __STDC_HOSTED__ 0
-// PPC-DARWIN:#define __STDC_VERSION__ 199901L
+// PPC-DARWIN:#define __STDC_VERSION__ 201112L
// PPC-DARWIN:#define __STDC__ 1
// PPC-DARWIN:#define __UINT16_C_SUFFIX__ {{$}}
// PPC-DARWIN:#define __UINT16_MAX__ 65535
diff --git a/clang/test/Preprocessor/line-directive.c b/clang/test/Preprocessor/line-directive.c
index 0dd658f7f1a..2ebe87e4680 100644
--- a/clang/test/Preprocessor/line-directive.c
+++ b/clang/test/Preprocessor/line-directive.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s
+// RUN: %clang_cc1 -std=c99 -fsyntax-only -verify -pedantic %s
// RUN: not %clang_cc1 -E %s 2>&1 | grep 'blonk.c:92:2: error: ABC'
// RUN: not %clang_cc1 -E %s 2>&1 | grep 'blonk.c:93:2: error: DEF'
diff --git a/clang/test/Sema/anonymous-struct-union-c11.c b/clang/test/Sema/anonymous-struct-union-c11.c
index 229ee520575..712e29e5496 100644
--- a/clang/test/Sema/anonymous-struct-union-c11.c
+++ b/clang/test/Sema/anonymous-struct-union-c11.c
@@ -1,8 +1,8 @@
// Check for warnings in non-C11 mode:
-// RUN: %clang_cc1 -fsyntax-only -verify -Wc11-extensions %s
+// RUN: %clang_cc1 -fsyntax-only -std=c99 -verify -Wc11-extensions %s
// Expect no warnings in C11 mode:
-// RUN: %clang_cc1 -fsyntax-only -pedantic -Werror -std=c11 %s
+// RUN: %clang_cc1 -fsyntax-only -std=c11 -pedantic -Werror %s
struct s {
int a;
diff --git a/clang/test/Sema/array-init.c b/clang/test/Sema/array-init.c
index 4cc5e412c2d..7cb48153168 100644
--- a/clang/test/Sema/array-init.c
+++ b/clang/test/Sema/array-init.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s
-// RUN: %clang_cc1 -fsyntax-only -Wgnu -Wc11-extensions -verify %s
+// RUN: %clang_cc1 -std=gnu99 -fsyntax-only -pedantic -verify %s
+// RUN: %clang_cc1 -std=gnu99 -fsyntax-only -Wgnu -Wc11-extensions -verify %s
// REQUIRES: LP64
extern int foof() = 1; // expected-error{{illegal initializer (only variables can be initialized)}}
diff --git a/clang/test/Sema/attr-deprecated.c b/clang/test/Sema/attr-deprecated.c
index c9e3dd546c5..2e3e722942a 100644
--- a/clang/test/Sema/attr-deprecated.c
+++ b/clang/test/Sema/attr-deprecated.c
@@ -121,6 +121,6 @@ struct test22 {
__attribute((deprecated)) foo_dep e, f;
};
-typedef int test23_ty __attribute((deprecated)); // expected-note {{previous definition is here}}
-typedef int test23_ty; // expected-note {{'test23_ty' has been explicitly marked deprecated here}} expected-warning {{redefinition of typedef 'test23_ty' is a C11 feature}}
+typedef int test23_ty __attribute((deprecated));
+typedef int test23_ty; // expected-note {{'test23_ty' has been explicitly marked deprecated here}}
test23_ty test23_v; // expected-warning {{'test23_ty' is deprecated}}
diff --git a/clang/test/Sema/types.c b/clang/test/Sema/types.c
index 6a22b20b0ea..1ed8dae4c80 100644
--- a/clang/test/Sema/types.c
+++ b/clang/test/Sema/types.c
@@ -30,12 +30,12 @@ int c() {
int __int128; // expected-error {{cannot combine with previous}} expected-warning {{does not declare anything}}
}
// __int128_t is __int128; __uint128_t is unsigned __int128.
-typedef __int128 check_int_128; // expected-note {{here}}
-typedef __int128_t check_int_128; // expected-note {{here}} expected-warning {{redefinition}}
+typedef __int128 check_int_128;
+typedef __int128_t check_int_128; // expected-note {{here}}
typedef int check_int_128; // expected-error {{different types ('int' vs '__int128_t' (aka '__int128'))}}
-typedef unsigned __int128 check_uint_128; // expected-note {{here}}
-typedef __uint128_t check_uint_128; // expected-note {{here}} expected-warning {{redefinition}}
+typedef unsigned __int128 check_uint_128;
+typedef __uint128_t check_uint_128; // expected-note {{here}}
typedef int check_uint_128; // expected-error {{different types ('int' vs '__uint128_t' (aka 'unsigned __int128'))}}
// Array type merging should convert array size to whatever matches the target
OpenPOWER on IntegriCloud