[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Driver / msp430-hwmult.c
blob3ba6bfcdce5f76bd70df1c4f871763878e558604
1 // Test that different values of -mhwmult pick correct
2 // MSP430 hwmult target-feature(s).
4 // RUN: %clang -### --target=msp430 %s 2>&1 | FileCheck %s
5 // RUN: %clang -### --target=msp430 %s -mhwmult=auto 2>&1 | FileCheck %s
6 // CHECK-NOT: "-target-feature" "+hwmult16"
7 // CHECK-NOT: "-target-feature" "+hwmult32"
8 // CHECK-NOT: "-target-feature" "+hwmultf5"
10 // RUN: %clang -### --target=msp430 %s -mhwmult=none 2>&1 | FileCheck --check-prefix=CHECK-NONE %s
11 // RUN: %clang -### --target=msp430 %s -mhwmult=none -mmcu=msp430f147 2>&1 | FileCheck --check-prefix=CHECK-NONE %s
12 // RUN: %clang -### --target=msp430 %s -mhwmult=none -mmcu=msp430f4783 2>&1 | FileCheck --check-prefix=CHECK-NONE %s
13 // CHECK-NONE: "-target-feature" "-hwmult16"
14 // CHECK-NONE: "-target-feature" "-hwmult32"
15 // CHECK-NONE: "-target-feature" "-hwmultf5"
17 // RUN: %clang -### --target=msp430 %s -mhwmult=16bit 2>&1 | FileCheck --check-prefix=CHECK-16 %s
18 // CHECK-16: "-target-feature" "+hwmult16"
20 // RUN: %clang -### --target=msp430 %s -mhwmult=32bit 2>&1 | FileCheck --check-prefix=CHECK-32 %s
21 // CHECK-32: "-target-feature" "+hwmult32"
23 // RUN: %clang -### --target=msp430 %s -mhwmult=f5series 2>&1 | FileCheck --check-prefix=CHECK-F5 %s
24 // CHECK-F5: "-target-feature" "+hwmultf5"
26 // RUN: not %clang -### --target=msp430 %s -mhwmult=rrr 2>&1 | FileCheck --check-prefix=INVL-ARG %s
27 // INVL-ARG: error: unsupported argument 'rrr' to option '-mhwmult='
29 // RUN: %clang -### --target=msp430 %s -mhwmult=auto 2>&1 | FileCheck --check-prefix=WRN-NODEV %s
30 // WRN-NODEV: warning: no MCU device specified, but '-mhwmult' is set to 'auto',
31 // assuming no hardware multiply; use '-mmcu' to specify a MSP430 device,
32 // or '-mhwmult' to set hardware multiply type explicitly.
34 // RUN: %clang -### --target=msp430 %s -mhwmult=16bit -mmcu=msp430c111 2>&1 | FileCheck --check-prefix=WRN-UNSUP %s
35 // RUN: %clang -### --target=msp430 %s -mhwmult=32bit -mmcu=msp430c111 2>&1 | FileCheck --check-prefix=WRN-UNSUP %s
36 // RUN: %clang -### --target=msp430 %s -mhwmult=f5series -mmcu=msp430c111 2>&1 | FileCheck --check-prefix=WRN-UNSUP %s
37 // WRN-UNSUP: warning: the given MCU does not support hardware multiply, but '-mhwmult' is set to
39 // RUN: %clang -### --target=msp430 %s -mhwmult=16bit -mmcu=msp430f4783 2>&1 | FileCheck --check-prefix=WRN-MISMCH %s
40 // RUN: %clang -### --target=msp430 %s -mhwmult=32bit -mmcu=msp430f147 2>&1 | FileCheck --check-prefix=WRN-MISMCH %s
41 // RUN: %clang -### --target=msp430 %s -mhwmult=f5series -mmcu=msp430f4783 2>&1 | FileCheck --check-prefix=WRN-MISMCH %s
42 // WRN-MISMCH: warning: the given MCU supports {{.*}} hardware multiply, but '-mhwmult' is set to {{.*}}