xref: /llvm-project/clang/test/Driver/arm-fix-cortex-a57-aes-1742098.c (revision 5c29ffda9056e1b4602a46051371f0184ce357b2)
13a24df99SArchibald Elliott // RUN: %clang -### %s -target arm-none-none-eabi -march=armv8a -mfix-cortex-a57-aes-1742098 2>&1 | FileCheck %s --check-prefix=FIX
23a24df99SArchibald Elliott // RUN: %clang -### %s -target arm-none-none-eabi -march=armv8a -mno-fix-cortex-a57-aes-1742098 2>&1 | FileCheck %s --check-prefix=NO-FIX
33a24df99SArchibald Elliott 
43a24df99SArchibald Elliott // RUN: %clang -### %s -target arm-none-none-eabi -march=armv8a -mfix-cortex-a72-aes-1655431 2>&1 | FileCheck %s --check-prefix=FIX
53a24df99SArchibald Elliott // RUN: %clang -### %s -target arm-none-none-eabi -march=armv8a -mno-fix-cortex-a72-aes-1655431 2>&1 | FileCheck %s --check-prefix=NO-FIX
63a24df99SArchibald Elliott 
73a24df99SArchibald Elliott // RUN: %clang -### %s -target arm-none-none-eabi -march=armv8a 2>&1 | FileCheck %s --check-prefix=UNSPEC
83a24df99SArchibald Elliott // RUN: %clang -### %s -target arm-none-none-eabi -march=armv8a 2>&1 | FileCheck %s --check-prefix=UNSPEC
93a24df99SArchibald Elliott 
103a24df99SArchibald Elliott // This test checks that "-m(no-)fix-cortex-a57-aes-1742098" and
113a24df99SArchibald Elliott // "-m(no-)fix-cortex-a72-aes-1655431" cause the "fix-cortex-a57-aes-1742098"
123a24df99SArchibald Elliott // target feature to be passed to `clang -cc1`.
13*5c29ffdaSFangrui Song //
143a24df99SArchibald Elliott // This feature is also enabled in the backend for the two affected CPUs and the
153a24df99SArchibald Elliott // "generic" cpu (used when only specifying -march), but that won't show up on
163a24df99SArchibald Elliott // the `clang -cc1` command line.
17*5c29ffdaSFangrui Song //
183a24df99SArchibald Elliott // We do not check whether this option is correctly specified for the CPU: users
193a24df99SArchibald Elliott // can specify the "-mfix-cortex-a57-aes-1742098" option with "-mcpu=cortex-a72"
203a24df99SArchibald Elliott // and vice-versa, and will still get the fix, as the target feature and the fix
213a24df99SArchibald Elliott // is the same in both cases.
223a24df99SArchibald Elliott 
233a24df99SArchibald Elliott // FIX: "-target-feature" "+fix-cortex-a57-aes-1742098"
243a24df99SArchibald Elliott // NO-FIX: "-target-feature" "-fix-cortex-a57-aes-1742098"
253a24df99SArchibald Elliott // UNSPEC-NOT: "-target-feature" "{[+-]}fix-cortex-a57-aes-1742098"
26