|
| 1 | +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --check-globals all --version 5 |
| 2 | +// RUN: %clang_cc1 -triple loongarch64 -emit-llvm %s -o - | FileCheck %s |
| 3 | + |
| 4 | +__attribute__((target("div32"))) |
| 5 | +// CHECK-LABEL: define dso_local void @testdiv32( |
| 6 | +// CHECK-SAME: ) #[[ATTR0:[0-9]+]] { |
| 7 | +// CHECK-NEXT: [[ENTRY:.*:]] |
| 8 | +// CHECK-NEXT: ret void |
| 9 | +// |
| 10 | +void testdiv32() {} |
| 11 | + |
| 12 | +__attribute__((target("arch=loongarch64"))) |
| 13 | +// CHECK-LABEL: define dso_local void @testLoongarch64( |
| 14 | +// CHECK-SAME: ) #[[ATTR1:[0-9]+]] { |
| 15 | +// CHECK-NEXT: [[ENTRY:.*:]] |
| 16 | +// CHECK-NEXT: ret void |
| 17 | +// |
| 18 | +void testLoongarch64() {} |
| 19 | + |
| 20 | +__attribute__((target("arch=la64v1.0"))) |
| 21 | +// CHECK-LABEL: define dso_local void @testLa64v10( |
| 22 | +// CHECK-SAME: ) #[[ATTR2:[0-9]+]] { |
| 23 | +// CHECK-NEXT: [[ENTRY:.*:]] |
| 24 | +// CHECK-NEXT: ret void |
| 25 | +// |
| 26 | +void testLa64v10() {} |
| 27 | + |
| 28 | +__attribute__((target("arch=la64v1.1"))) |
| 29 | +// CHECK-LABEL: define dso_local void @testLa64v11( |
| 30 | +// CHECK-SAME: ) #[[ATTR3:[0-9]+]] { |
| 31 | +// CHECK-NEXT: [[ENTRY:.*:]] |
| 32 | +// CHECK-NEXT: ret void |
| 33 | +// |
| 34 | +void testLa64v11() {} |
| 35 | + |
| 36 | +__attribute__((target("arch=la464"))) |
| 37 | +// CHECK-LABEL: define dso_local void @testLa464( |
| 38 | +// CHECK-SAME: ) #[[ATTR4:[0-9]+]] { |
| 39 | +// CHECK-NEXT: [[ENTRY:.*:]] |
| 40 | +// CHECK-NEXT: ret void |
| 41 | +// |
| 42 | +void testLa464() {} |
| 43 | + |
| 44 | +__attribute__((target("arch=la664"))) |
| 45 | +// CHECK-LABEL: define dso_local void @testLa664( |
| 46 | +// CHECK-SAME: ) #[[ATTR5:[0-9]+]] { |
| 47 | +// CHECK-NEXT: [[ENTRY:.*:]] |
| 48 | +// CHECK-NEXT: ret void |
| 49 | +// |
| 50 | +void testLa664() {} |
| 51 | + |
| 52 | +__attribute__((target("arch=la664, no-div32"))) |
| 53 | +// CHECK-LABEL: define dso_local void @la664Nodiv32( |
| 54 | +// CHECK-SAME: ) #[[ATTR6:[0-9]+]] { |
| 55 | +// CHECK-NEXT: [[ENTRY:.*:]] |
| 56 | +// CHECK-NEXT: ret void |
| 57 | +// |
| 58 | +void la664Nodiv32() {} |
| 59 | + |
| 60 | +__attribute__((target("tune=la464"))) |
| 61 | +// CHECK-LABEL: define dso_local void @tuneLa464( |
| 62 | +// CHECK-SAME: ) #[[ATTR7:[0-9]+]] { |
| 63 | +// CHECK-NEXT: [[ENTRY:.*:]] |
| 64 | +// CHECK-NEXT: ret void |
| 65 | +// |
| 66 | +void tuneLa464() {} |
| 67 | + |
| 68 | +__attribute__((target("arch=la464, tune=la664"))) |
| 69 | +// CHECK-LABEL: define dso_local void @archLa464tuneLa664( |
| 70 | +// CHECK-SAME: ) #[[ATTR8:[0-9]+]] { |
| 71 | +// CHECK-NEXT: [[ENTRY:.*:]] |
| 72 | +// CHECK-NEXT: ret void |
| 73 | +// |
| 74 | +void archLa464tuneLa664() {} |
| 75 | + |
| 76 | +//. |
| 77 | +// CHECK: attributes #[[ATTR0]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+64bit,+div32" } |
| 78 | +// CHECK: attributes #[[ATTR1]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="loongarch64" "target-features"="+64bit,+d,+f,+ual" } |
| 79 | +// CHECK: attributes #[[ATTR2]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="loongarch64" "target-features"="+64bit,+d,+lsx,+ual" } |
| 80 | +// CHECK: attributes #[[ATTR3]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="loongarch64" "target-features"="+64bit,+d,+div32,+frecipe,+lam-bh,+lamcas,+ld-seq-sa,+lsx,+scq,+ual" } |
| 81 | +// CHECK: attributes #[[ATTR4]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="la464" "target-features"="+64bit,+d,+f,+lasx,+lsx,+ual" } |
| 82 | +// CHECK: attributes #[[ATTR5]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="la664" "target-features"="+64bit,+d,+div32,+f,+frecipe,+lam-bh,+lamcas,+lasx,+ld-seq-sa,+lsx,+scq,+ual" } |
| 83 | +// CHECK: attributes #[[ATTR6]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="la664" "target-features"="+64bit,+d,+f,+frecipe,+lam-bh,+lamcas,+lasx,+ld-seq-sa,+lsx,+scq,+ual,-div32" } |
| 84 | +// CHECK: attributes #[[ATTR7]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+64bit" "tune-cpu"="la464" } |
| 85 | +// CHECK: attributes #[[ATTR8]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="la464" "target-features"="+64bit,+d,+f,+lasx,+lsx,+ual" "tune-cpu"="la664" } |
| 86 | +//. |
| 87 | +// CHECK: [[META0:![0-9]+]] = !{i32 1, !"wchar_size", i32 4} |
| 88 | +// CHECK: [[META1:![0-9]+]] = !{!"{{.*}}clang version {{.*}}"} |
| 89 | +//. |
0 commit comments