blob: 2122a7468d039975be9e705adba1c877f2eb3c8d [file] [log] [blame]
Richard Smithc91daf12017-02-14 22:44:20 +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
Richard Smithb0fe7042017-04-26 23:44:33 +00005// 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
Kelvin Liaf7c0ef2017-12-12 18:33:39 +00007// RUN: not %clang -x cuda -nocudainc -nocudalib --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s -std=foobar -c 2>&1 | FileCheck --match-full-lines --check-prefix=CHECK --check-prefix=CUDA %s
Richard Smithc91daf12017-02-14 22:44:20 +00008
9// CHECK: error: invalid value 'foobar' in '-std=foobar'
Richard Smith8c8fb802017-04-27 01:17:05 +000010// CHECK-NEXT: note: use 'c++98' or 'c++03' for 'ISO C++ 1998 with amendments' standard
11// CHECK-NEXT: note: use 'gnu++98' or 'gnu++03' for 'ISO C++ 1998 with amendments and GNU extensions' standard
Richard Smithc91daf12017-02-14 22:44:20 +000012// CHECK-NEXT: note: use 'c++11' for 'ISO C++ 2011 with amendments' standard
Richard Smithc91daf12017-02-14 22:44:20 +000013// CHECK-NEXT: note: use 'gnu++11' for 'ISO C++ 2011 with amendments and GNU extensions' standard
Richard Smithc91daf12017-02-14 22:44:20 +000014// CHECK-NEXT: note: use 'c++14' for 'ISO C++ 2014 with amendments' standard
Richard Smithc91daf12017-02-14 22:44:20 +000015// CHECK-NEXT: note: use 'gnu++14' for 'ISO C++ 2014 with amendments and GNU extensions' standard
Hans Wennborg7d928cc2017-08-09 20:12:53 +000016// CHECK-NEXT: note: use 'c++17' for 'ISO C++ 2017 with amendments' standard
17// CHECK-NEXT: note: use 'gnu++17' for 'ISO C++ 2017 with amendments and GNU extensions' standard
Faisal Vali5f475b92017-07-16 00:23:04 +000018// CHECK-NEXT: note: use 'c++2a' for 'Working draft for ISO C++ 2020' standard
19// CHECK-NEXT: note: use 'gnu++2a' for 'Working draft for ISO C++ 2020 with GNU extensions' standard
Richard Smithb0fe7042017-04-26 23:44:33 +000020// CUDA-NEXT: note: use 'cuda' for 'NVIDIA CUDA(tm)' standard
Richard Smithc91daf12017-02-14 22:44:20 +000021
22// Make sure that no other output is present.
23// CHECK-NOT: {{^.+$}}
24