This addresses an existing FIXME item in the driver. The code model flag was parsed in the actual tool rather than in the driver. This was problematic since the value may be invalid. In that case, we would silently treat it as a default value in non-assert builds, and abort in assert builds. Add a check in the driver to validate that the value being passed is valid, and if not provide a proper error message. llvm-svn: 208275
14 lines
674 B
C
14 lines
674 B
C
// RUN: %clang -### -c -mcmodel=small %s 2>&1 | FileCheck -check-prefix CHECK-SMALL %s
|
|
// RUN: %clang -### -S -mcmodel=kernel %s 2>&1 | FileCheck -check-prefix CHECK-KERNEL %s
|
|
// RUN: %clang -### -c -mcmodel=medium %s 2>&1 | FileCheck -check-prefix CHECK-MEDIUM %s
|
|
// RUN: %clang -### -S -mcmodel=large %s 2>&1 | FileCheck -check-prefix CHECK-LARGE %s
|
|
// RUN: not %clang -c -mcmodel=lager %s 2>&1 | FileCheck -check-prefix CHECK-INVALID %s
|
|
|
|
// CHECK-SMALL: "-mcode-model" "small"
|
|
// CHECK-KERNEL: "-mcode-model" "kernel"
|
|
// CHECK-MEDIUM: "-mcode-model" "medium"
|
|
// CHECK-LARGE: "-mcode-model" "large"
|
|
|
|
// CHECK-INVALID: error: invalid value 'lager' in '-mcode-model lager'
|
|
|