31 lines · cpp
1// This file checks output given when processing C++/ObjC++ files.2// When user selects invalid language standard3// print out supported values with short description.4 5// RUN: not %clang %s -std=foobar -c 2>&1 | FileCheck --match-full-lines %s6// RUN: not %clang -x objective-c++ %s -std=foobar -c 2>&1 | FileCheck --match-full-lines %s7// RUN: not %clang -x cuda -nocudainc -nocudalib --cuda-path=%S/Inputs/CUDA/usr/local/cuda \8// RUN: %s -std=foobar -c 2>&1 | FileCheck --match-full-lines %s9// RUN: not %clang -x hip -nocudainc -nocudalib %s -std=foobar -c 2>&1 \10// RUN: | FileCheck --match-full-lines %s11 12// CHECK: error: invalid value 'foobar' in '-std=foobar'13// CHECK-NEXT: note: use 'c++98' or 'c++03' for 'ISO C++ 1998 with amendments' standard14// CHECK-NEXT: note: use 'gnu++98' or 'gnu++03' for 'ISO C++ 1998 with amendments and GNU extensions' standard15// CHECK-NEXT: note: use 'c++11' for 'ISO C++ 2011 with amendments' standard16// CHECK-NEXT: note: use 'gnu++11' for 'ISO C++ 2011 with amendments and GNU extensions' standard17// CHECK-NEXT: note: use 'c++14' for 'ISO C++ 2014 with amendments' standard18// CHECK-NEXT: note: use 'gnu++14' for 'ISO C++ 2014 with amendments and GNU extensions' standard19// CHECK-NEXT: note: use 'c++17' for 'ISO C++ 2017 with amendments' standard20// CHECK-NEXT: note: use 'gnu++17' for 'ISO C++ 2017 with amendments and GNU extensions' standard21// CHECK-NEXT: note: use 'c++20' for 'ISO C++ 2020 DIS' standard22// CHECK-NEXT: note: use 'gnu++20' for 'ISO C++ 2020 DIS with GNU extensions' standard23// CHECK-NEXT: note: use 'c++23' for 'ISO C++ 2023 DIS' standard24// CHECK-NEXT: note: use 'gnu++23' for 'ISO C++ 2023 DIS with GNU extensions' standard25// CHECK-NEXT: note: use 'c++2c' or 'c++26' for 'Working draft for C++2c' standard26// CHECK-NEXT: note: use 'gnu++2c' or 'gnu++26' for 'Working draft for C++2c with GNU extensions' standard27 28// Make sure that no other output is present.29// CHECK-NOT: {{^.+$}}30 31