forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: If5684cdce3bd26d978424346a19539bb9add5151
- Loading branch information
Showing
34 changed files
with
3,298 additions
and
2,578 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// REQUIRES: riscv-registered-target | ||
// RUN: not %clang_cc1 -triple riscv64 -target-feature +zifencei -target-feature +m -target-feature +a \ | ||
// RUN: -emit-llvm %s 2>&1 | FileCheck %s | ||
|
||
// CHECK: error: duplicate 'arch=' in the 'target' attribute string; | ||
__attribute__((target("arch=rv64gc;arch=rv64gc_zbb"))) void testMultiArchSelectLast() {} | ||
// CHECK: error: duplicate 'cpu=' in the 'target' attribute string; | ||
__attribute__((target("cpu=sifive-u74;cpu=sifive-u54"))) void testMultiCpuSelectLast() {} | ||
// CHECK: error: duplicate 'tune=' in the 'target' attribute string; | ||
__attribute__((target("tune=sifive-u74;tune=sifive-u54"))) void testMultiTuneSelectLast() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// REQUIRES: riscv-registered-target | ||
// RUN: %clang_cc1 -triple riscv64 -target-feature +zifencei -target-feature +m \ | ||
// RUN: -target-feature +a -target-feature +save-restore \ | ||
// RUN: -emit-llvm %s -o - | FileCheck %s | ||
|
||
// CHECK-LABEL: define dso_local void @testDefault | ||
// CHECK-SAME: () #0 { | ||
void testDefault() {} | ||
// CHECK-LABEL: define dso_local void @testMultiAttrStr | ||
// CHECK-SAME: () #1 { | ||
__attribute__((target("cpu=rocket-rv64;tune=generic-rv64;arch=+v"))) void | ||
testMultiAttrStr() {} | ||
// CHECK-LABEL: define dso_local void @testSingleExtension | ||
// CHECK-SAME: () #2 { | ||
__attribute__((target("arch=+zbb"))) void testSingleExtension() {} | ||
// CHECK-LABEL: define dso_local void @testMultiExtension | ||
// CHECK-SAME: () #3 { | ||
__attribute__((target("arch=+zbb,+v,+zicond"))) void testMultiExtension() {} | ||
// CHECK-LABEL: define dso_local void @testFullArch | ||
// CHECK-SAME: () #4 { | ||
__attribute__((target("arch=rv64gc_zbb"))) void testFullArch() {} | ||
// CHECK-LABEL: define dso_local void @testFullArchButSmallThanCmdArch | ||
// CHECK-SAME: () #5 { | ||
__attribute__((target("arch=rv64im"))) void testFullArchButSmallThanCmdArch() {} | ||
// CHECK-LABEL: define dso_local void @testAttrArchAndAttrCpu | ||
// CHECK-SAME: () #6 { | ||
__attribute__((target("cpu=sifive-u54;arch=+zbb"))) void | ||
testAttrArchAndAttrCpu() {} | ||
// CHECK-LABEL: define dso_local void @testAttrFullArchAndAttrCpu | ||
// CHECK-SAME: () #7 { | ||
__attribute__((target("cpu=sifive-u54;arch=rv64im"))) void | ||
testAttrFullArchAndAttrCpu() {} | ||
// CHECK-LABEL: define dso_local void @testAttrCpuOnly | ||
// CHECK-SAME: () #8 { | ||
__attribute__((target("cpu=sifive-u54"))) void testAttrCpuOnly() {} | ||
|
||
//. | ||
// CHECK: attributes #0 = { {{.*}}"target-features"="+64bit,+a,+m,+save-restore,+zifencei" } | ||
// CHECK: attributes #1 = { {{.*}}"target-cpu"="rocket-rv64" "target-features"="+64bit,+a,+d,+f,+m,+save-restore,+v,+zicsr,+zifencei,+zve32f,+zve32x,+zve64d,+zve64f,+zve64x,+zvl128b,+zvl32b,+zvl64b" "tune-cpu"="generic-rv64" } | ||
// CHECK: attributes #2 = { {{.*}}"target-features"="+64bit,+a,+m,+save-restore,+zbb,+zifencei" } | ||
// CHECK: attributes #3 = { {{.*}}"target-features"="+64bit,+a,+d,+experimental-zicond,+f,+m,+save-restore,+v,+zbb,+zicsr,+zifencei,+zve32f,+zve32x,+zve64d,+zve64f,+zve64x,+zvl128b,+zvl32b,+zvl64b" } | ||
// CHECK: attributes #4 = { {{.*}}"target-features"="+64bit,+a,+c,+d,+f,+m,+save-restore,+zbb,+zicsr,+zifencei" } | ||
// CHECK: attributes #5 = { {{.*}}"target-features"="+64bit,+m,+save-restore" } | ||
// CHECK: attributes #6 = { {{.*}}"target-cpu"="sifive-u54" "target-features"="+64bit,+a,+m,+save-restore,+zbb,+zifencei" } | ||
// CHECK: attributes #7 = { {{.*}}"target-cpu"="sifive-u54" "target-features"="+64bit,+m,+save-restore" } | ||
// CHECK: attributes #8 = { {{.*}}"target-cpu"="sifive-u54" "target-features"="+64bit,+a,+c,+d,+f,+m,+save-restore,+zicsr,+zifencei" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
; REQUIRES: loongarch | ||
;; Test we can infer the e_machine value EM_LOONGARCH from a bitcode file. | ||
|
||
; RUN: split-file %s %t | ||
; RUN: llvm-as %t/32.ll -o %t/32.o | ||
; RUN: ld.lld %t/32.o -o %t/32 | ||
; RUN: llvm-readobj -h %t/32 | FileCheck %s --check-prefixes=CHECK,LA32 | ||
|
||
; RUN: llvm-as %t/64.ll -o %t/64.o | ||
; RUN: ld.lld %t/64.o -o %t/64 | ||
; RUN: llvm-readobj -h %t/64 | FileCheck %s --check-prefixes=CHECK,LA64 | ||
|
||
; LA32: Class: 32-bit | ||
; LA64: Class: 64-bit | ||
; CHECK: DataEncoding: LittleEndian | ||
; CHECK: Machine: EM_LOONGARCH | ||
|
||
;--- 32.ll | ||
target datalayout = "e-m:e-p:32:32-i64:64-n32-S128" | ||
target triple = "loongarch32-unknown-elf" | ||
|
||
define void @_start() { | ||
ret void | ||
} | ||
|
||
;--- 64.ll | ||
target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n64-S128" | ||
target triple = "loongarch64-unknown-elf" | ||
|
||
define void @_start() { | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.