2015-05-07 07:54:14 +08:00
|
|
|
; RUN: opt < %s -mtriple=x86_64-apple-darwin -mcpu=broadwell -mattr=+avx2 -S | FileCheck %s
|
|
|
|
|
2019-12-09 19:37:14 +08:00
|
|
|
; Check that opt can add but not rewrite function attributes
|
|
|
|
; target-cpu and target-features using command line options -mcpu and
|
|
|
|
; -mattr.
|
2015-05-07 07:54:14 +08:00
|
|
|
|
2019-12-09 20:33:25 +08:00
|
|
|
; CHECK: attributes #0 = { nounwind readnone ssp uwtable "target-cpu"="broadwell" "target-features"="+ssse3,+cx16,+sse,+sse2,+sse3,+avx2" "use-soft-float"="false" }
|
|
|
|
; CHECK: attributes #1 = { nounwind readnone ssp uwtable "target-cpu"="core2" "target-features"="+ssse3,+cx16,+sse,+sse2,+sse3,+avx2" "use-soft-float"="false" }
|
2015-05-07 07:54:14 +08:00
|
|
|
|
2019-12-09 19:37:14 +08:00
|
|
|
define i32 @no_target_cpu() #0 {
|
2015-05-07 07:54:14 +08:00
|
|
|
entry:
|
|
|
|
ret i32 0
|
|
|
|
}
|
|
|
|
|
2019-12-09 19:37:14 +08:00
|
|
|
define i32 @has_targe_cpu() #1 {
|
|
|
|
entry:
|
|
|
|
ret i32 0
|
|
|
|
}
|
|
|
|
|
|
|
|
attributes #0 = { nounwind readnone ssp uwtable "target-features"="+ssse3,+cx16,+sse,+sse2,+sse3" "use-soft-float"="false" }
|
|
|
|
attributes #1 = { nounwind readnone ssp uwtable "target-cpu"="core2" "target-features"="+ssse3,+cx16,+sse,+sse2,+sse3" "use-soft-float"="false" }
|