| 1 |
;RUN: llvm-as %s -o %t.bc |
| 2 |
;RUN: llvm-spirv %t.bc -o %t.spv |
| 3 |
;RUN: llvm-spirv %t.spv -to-text -o - | FileCheck %s --check-prefix=CHECK-SPIRV |
| 4 |
;RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.rev.bc |
| 5 |
;RUN: llvm-dis %t.rev.bc -o - | FileCheck %s --check-prefix=CHECK-LLVM |
| 6 |
|
| 7 |
;CHECK-SPIRV: Decorate {{[0-9]+}} UserSemantic "annotation_on_function" |
| 8 |
|
| 9 |
;CHECK-LLVM: @0 = private unnamed_addr constant [23 x i8] c"annotation_on_function\00", section "llvm.metadata" |
| 10 |
;CHECK-LLVM: @llvm.global.annotations = appending global [1 x { ptr, ptr, ptr, i32, ptr }] [{ ptr, ptr, ptr, i32, ptr } { ptr @foo, ptr @0, ptr undef, i32 undef, ptr undef }], section "llvm.metadata" |
| 11 |
|
| 12 |
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64" |
| 13 |
target triple = "spir64-unknown-linux" |
| 14 |
|
| 15 |
@.str = private unnamed_addr constant [23 x i8] c"annotation_on_function\00", section "llvm.metadata" |
| 16 |
@.str.1 = private unnamed_addr constant [6 x i8] c"an.cl\00", section "llvm.metadata" |
| 17 |
@llvm.global.annotations = appending global [1 x { i8*, i8*, i8*, i32, i8* }] [{ i8*, i8*, i8*, i32, i8* } { i8* bitcast (void ()* @foo to i8*), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i32 2, i8* null }], section "llvm.metadata" |
| 18 |
|
| 19 |
; Function Attrs: convergent norecurse nounwind |
| 20 |
define dso_local spir_func void @foo() #0 { |
| 21 |
entry: |
| 22 |
ret void |
| 23 |
} |
| 24 |
|
| 25 |
attributes #0 = { convergent norecurse nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 26 |
|
| 27 |
!llvm.module.flags = !{!0} |
| 28 |
!opencl.ocl.version = !{!1} |
| 29 |
!opencl.spir.version = !{!2, !2} |
| 30 |
!spirv.Source = !{!3} |
| 31 |
!llvm.ident = !{!4} |
| 32 |
|
| 33 |
!0 = !{i32 1, !"wchar_size", i32 4} |
| 34 |
!1 = !{i32 1, i32 0} |
| 35 |
!2 = !{i32 1, i32 2} |
| 36 |
!3 = !{i32 4, i32 100000} |
| 37 |
!4 = !{!"clang version 12.0.0 (https://github.com/c199914007/llvm.git 074e97d48896b959dfc832e2f1dd806796cde390)"} |