summaryrefslogtreecommitdiffstats
path: root/llvm/test/Other/opt-override-mcpu-mattr.ll
blob: 967df2c7af83514820f673fcbac47b2f569546f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
; RUN: opt < %s -mtriple=x86_64-apple-darwin -mcpu=broadwell -mattr=+avx2 -S | FileCheck %s

; Check that opt can add but not rewrite function attributes
; target-cpu and target-features using command line options -mcpu and
; -mattr.

; CHECK: attributes #0 = { nounwind readnone ssp uwtable "target-cpu"="broadwell" "target-features"="+avx2" "use-soft-float"="false" }
; CHECK: attributes #1 = { nounwind readnone ssp uwtable "target-cpu"="core2" "target-features"="+avx2" "use-soft-float"="false" }

define i32 @no_target_cpu() #0 {
entry:
  ret i32 0
}

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" }
OpenPOWER on IntegriCloud