mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-17 00:36:05 +00:00

As described in D40225, the C17 standard was balloted and approved in 2017, but the ISO publication process delayed the actual publication until 2018. WG14 considers the release to be C17 and describes it as such, but users can still be confused by the publication year which is why -std=c18 adds value. These aliases map to c17 and are all supported by GCC 8.x with the same behavior. Note that the value of __STDC_VERSION__ remains at 201710L. llvm-svn: 344749
23 lines
1.3 KiB
C
23 lines
1.3 KiB
C
// This file checks output given when processing C/ObjC files.
|
|
// When user selects invalid language standard
|
|
// print out supported values with short description.
|
|
|
|
// RUN: not %clang %s -std=foobar -c 2>&1 | FileCheck --match-full-lines %s
|
|
// RUN: not %clang -x objective-c %s -std=foobar -c 2>&1 | FileCheck --match-full-lines %s
|
|
// RUN: not %clang -x renderscript %s -std=foobar -c 2>&1 | FileCheck --match-full-lines %s
|
|
|
|
// CHECK: error: invalid value 'foobar' in '-std=foobar'
|
|
// CHECK-NEXT: note: use 'c89', 'c90', or 'iso9899:1990' for 'ISO C 1990' standard
|
|
// CHECK-NEXT: note: use 'iso9899:199409' for 'ISO C 1990 with amendment 1' standard
|
|
// CHECK-NEXT: note: use 'gnu89' or 'gnu90' for 'ISO C 1990 with GNU extensions' standard
|
|
// CHECK-NEXT: note: use 'c99' or 'iso9899:1999' for 'ISO C 1999' standard
|
|
// CHECK-NEXT: note: use 'gnu99' for 'ISO C 1999 with GNU extensions' standard
|
|
// CHECK-NEXT: note: use 'c11' or 'iso9899:2011' for 'ISO C 2011' standard
|
|
// CHECK-NEXT: note: use 'gnu11' for 'ISO C 2011 with GNU extensions' standard
|
|
// CHECK-NEXT: note: use 'c17', 'iso9899:2017', 'c18', or 'iso9899:2018' for 'ISO C 2017' standard
|
|
// CHECK-NEXT: note: use 'gnu17' or 'gnu18' for 'ISO C 2017 with GNU extensions' standard
|
|
|
|
// Make sure that no other output is present.
|
|
// CHECK-NOT: {{^.+$}}
|
|
|