Files
clang-p2996/clang/test/Driver/no-knr-functions.c
Aaron Ballman 786954db06 Accept -fno-knr-functions as a driver flag as well
Due to a think-o, it was only being accepted as a -cc1 flag. This adds
the proper forwarding from the driver to the frontend and adds test
coverage for the option.
2022-04-30 13:37:55 -04:00

16 lines
969 B
C

// Ensure that we cannot disable strict prototypes, no matter how hard we try.
// RUN: not %clang -fno-no-knr-functions -x c++ %s 2>&1 | FileCheck --check-prefixes=NONO %s
// RUN: not %clang -fno-no-knr-functions -x c %s 2>&1 | FileCheck --check-prefixes=NONO %s
// RUN: not %clang -fno-no-knr-functions -std=c89 -x c %s 2>&1 | FileCheck --check-prefixes=NONO %s
// RUN: not %clang -fknr-functions -x c++ %s 2>&1 | FileCheck --check-prefixes=POS %s
// RUN: not %clang -fknr-functions -x c %s 2>&1 | FileCheck --check-prefixes=POS %s
// RUN: not %clang -fknr-functions -std=c89 -x c %s 2>&1 | FileCheck --check-prefixes=POS %s
// Ensure that the driver flag is actually accepted though.
// RUN: %clang -fno-knr-functions -### %s 2>&1 | FileCheck --check-prefixes=ACCEPTED %s
// NONO: error: unknown argument: '-fno-no-knr-functions'
// POS: error: unknown argument: '-fknr-functions'
// ACCEPTED-NOT: warning: argument unused during compilation: '-fno-knr-functions'