blob: d87a968894b36d0c72790674e3119d6ae9561e51 [file] [log] [blame]
Aaron Ballman29dc5de2017-12-07 23:04:11 +00001// This file checks output given when processing C/ObjC files.
2// When user selects invalid language standard
3// print out supported values with short description.
4
5// RUN: not %clang %s -std=foobar -c 2>&1 | FileCheck --match-full-lines %s
6// RUN: not %clang -x objective-c %s -std=foobar -c 2>&1 | FileCheck --match-full-lines %s
7// RUN: not %clang -x renderscript %s -std=foobar -c 2>&1 | FileCheck --match-full-lines %s
8
9// CHECK: error: invalid value 'foobar' in '-std=foobar'
10// CHECK-NEXT: note: use 'c89', 'c90', or 'iso9899:1990' for 'ISO C 1990' standard
11// CHECK-NEXT: note: use 'iso9899:199409' for 'ISO C 1990 with amendment 1' standard
12// CHECK-NEXT: note: use 'gnu89' or 'gnu90' for 'ISO C 1990 with GNU extensions' standard
13// CHECK-NEXT: note: use 'c99' or 'iso9899:1999' for 'ISO C 1999' standard
14// CHECK-NEXT: note: use 'gnu99' for 'ISO C 1999 with GNU extensions' standard
15// CHECK-NEXT: note: use 'c11' or 'iso9899:2011' for 'ISO C 2011' standard
16// CHECK-NEXT: note: use 'gnu11' for 'ISO C 2011 with GNU extensions' standard
Aaron Ballman8bcf10f2018-10-18 17:42:41 +000017// CHECK-NEXT: note: use 'c17', 'iso9899:2017', 'c18', or 'iso9899:2018' for 'ISO C 2017' standard
18// CHECK-NEXT: note: use 'gnu17' or 'gnu18' for 'ISO C 2017 with GNU extensions' standard
Aaron Ballmand06f3912019-05-14 12:09:55 +000019// CHECK-NEXT: note: use 'c2x' for 'Working Draft for ISO C2x' standard
20// CHECK-NEXT: note: use 'gnu2x' for 'Working Draft for ISO C2x with GNU extensions' standard
Aaron Ballman29dc5de2017-12-07 23:04:11 +000021
22// Make sure that no other output is present.
23// CHECK-NOT: {{^.+$}}
24