aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Driver/loongarch-mlamcas.c
blob: 2185a1a8115d66092385bb415b1e60d0e881742d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/// Test -m[no]lamcas options.

// RUN: %clang --target=loongarch64 -mlamcas -fsyntax-only %s -### 2>&1 | \
// RUN:     FileCheck %s --check-prefix=CC1-LAMCAS
// RUN: %clang --target=loongarch64 -mno-lamcas -fsyntax-only %s -### 2>&1 | \
// RUN:     FileCheck %s --check-prefix=CC1-NO-LAMCAS
// RUN: %clang --target=loongarch64 -mno-lamcas -mlamcas -fsyntax-only %s -### 2>&1 | \
// RUN:     FileCheck %s --check-prefix=CC1-LAMCAS
// RUN: %clang --target=loongarch64  -mlamcas -mno-lamcas -fsyntax-only %s -### 2>&1 | \
// RUN:     FileCheck %s --check-prefix=CC1-NO-LAMCAS

// RUN: %clang --target=loongarch64 -mlamcas -S -emit-llvm %s -o - | \
// RUN: FileCheck %s --check-prefix=IR-LAMCAS
// RUN: %clang --target=loongarch64 -mno-lamcas -S -emit-llvm %s -o - | \
// RUN: FileCheck %s --check-prefix=IR-NO-LAMCAS
// RUN: %clang --target=loongarch64 -mno-lamcas -mlamcas -S -emit-llvm %s -o - | \
// RUN: FileCheck %s --check-prefix=IR-LAMCAS
// RUN: %clang --target=loongarch64 -mlamcas -mno-lamcas -S -emit-llvm %s -o - | \
// RUN: FileCheck %s --check-prefix=IR-NO-LAMCAS


// CC1-LAMCAS: "-target-feature" "+lamcas"
// CC1-NO-LAMCAS: "-target-feature" "-lamcas"

// IR-LAMCAS: attributes #[[#]] ={{.*}}"target-features"="{{(.*,)?}}+lamcas{{(,.*)?}}"
// IR-NO-LAMCAS: attributes #[[#]] ={{.*}}"target-features"="{{(.*,)?}}-lamcas{{(,.*)?}}"

int foo(void) {
  return 42;
}