[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Driver / loongarch-munaligned-access.c
bloba545679949973a6e94910e9c1d8e0a79bfb173e6
1 /// Test -m[no-]unaligned-access and -m[no-]strict-align options.
3 // RUN: %clang --target=loongarch64 -mstrict-align -fsyntax-only %s -### 2>&1 | \
4 // RUN: FileCheck %s --check-prefix=CC1-NO-UNALIGNED
5 // RUN: %clang --target=loongarch64 -mno-strict-align -fsyntax-only %s -### 2>&1 | \
6 // RUN: FileCheck %s --check-prefix=CC1-UNALIGNED
7 // RUN: %clang --target=loongarch64 -mstrict-align -mno-strict-align -fsyntax-only %s -### 2>&1 | \
8 // RUN: FileCheck %s --check-prefix=CC1-UNALIGNED
9 // RUN: %clang --target=loongarch64 -mno-strict-align -mstrict-align -fsyntax-only %s -### 2>&1 | \
10 // RUN: FileCheck %s --check-prefix=CC1-NO-UNALIGNED
12 // RUN: %clang --target=loongarch64 -mstrict-align -S -emit-llvm %s -o - | \
13 // RUN: FileCheck %s --check-prefix=IR-NO-UNALIGNED
14 // RUN: %clang --target=loongarch64 -mno-strict-align -S -emit-llvm %s -o - | \
15 // RUN: FileCheck %s --check-prefix=IR-UNALIGNED
16 // RUN: %clang --target=loongarch64 -mstrict-align -mno-strict-align -S -emit-llvm %s -o - | \
17 // RUN: FileCheck %s --check-prefix=IR-UNALIGNED
18 // RUN: %clang --target=loongarch64 -mno-strict-align -mstrict-align -S -emit-llvm %s -o - | \
19 // RUN: FileCheck %s --check-prefix=IR-NO-UNALIGNED
21 // RUN: not %clang -### --target=loongarch64 -mno-unaligned-access -munaligned-access %s 2>&1 | \
22 // RUN: FileCheck %s --check-prefix=ERR
24 // CC1-UNALIGNED: "-target-feature" "+ual"
25 // CC1-NO-UNALIGNED: "-target-feature" "-ual"
27 // IR-UNALIGNED: attributes #[[#]] ={{.*}}"target-features"="{{(.*,)?}}+ual{{(,.*)?}}"
28 // IR-NO-UNALIGNED: attributes #[[#]] ={{.*}}"target-features"="{{(.*,)?}}-ual{{(,.*)?}}"
30 // ERR: error: unsupported option '-mno-unaligned-access' for target 'loongarch64'
31 // ERR: error: unsupported option '-munaligned-access' for target 'loongarch64'
33 int foo(void) {
34 return 3;