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