CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
123 lines
2.0 KiB
NASM
123 lines
2.0 KiB
NASM
; RUN: llvm-ml -filetype=s %s /Fo - | FileCheck %s
|
|
|
|
.code
|
|
|
|
identity MACRO arg
|
|
exitm <arg>
|
|
endm
|
|
|
|
argument_test PROC
|
|
; CHECK-LABEL: argument_test:
|
|
|
|
mov eax, identity(2)
|
|
; CHECK: mov eax, 2
|
|
|
|
ret
|
|
argument_test ENDP
|
|
|
|
argument_with_parens_test PROC
|
|
; CHECK-LABEL: argument_with_parens_test:
|
|
|
|
mov eax, identity((3))
|
|
; CHECK: mov eax, 3
|
|
mov eax, identity(((4-1)-1))
|
|
; CHECK: mov eax, 2
|
|
|
|
ret
|
|
argument_with_parens_test ENDP
|
|
|
|
offsetof MACRO structure, field
|
|
EXITM <structure.&field>
|
|
ENDM
|
|
|
|
S1 STRUCT
|
|
W byte 0
|
|
X byte 0
|
|
Y byte 0
|
|
S1 ENDS
|
|
|
|
substitutions_test PROC
|
|
; CHECK-LABEL: substitutions_test:
|
|
|
|
mov eax, offsetof(S1, X)
|
|
; CHECK: mov eax, 1
|
|
mov eax, offsetof(S1, Y)
|
|
; CHECK: mov eax, 2
|
|
|
|
ret
|
|
substitutions_test ENDP
|
|
|
|
repeated_invocations_test PROC
|
|
; CHECK-LABEL: repeated_invocations_test:
|
|
|
|
mov eax, identity(identity(1))
|
|
; CHECK: mov eax, 1
|
|
|
|
ret
|
|
repeated_invocations_test ENDP
|
|
|
|
factorial MACRO n
|
|
IF n LE 1
|
|
EXITM <(1)>
|
|
ELSE
|
|
EXITM <(n)*factorial(n-1)>
|
|
ENDIF
|
|
ENDM
|
|
|
|
; NOTE: This version is more sensitive to unintentional end-of-statement tokens.
|
|
factorial2 MACRO n
|
|
IF n LE 1
|
|
EXITM <(1)>
|
|
ELSE
|
|
EXITM <(n)*(factorial(n-1))>
|
|
ENDIF
|
|
ENDM
|
|
|
|
string_recursive_test PROC
|
|
; CHECK-LABEL: string_recursive_test:
|
|
|
|
mov eax, factorial(5)
|
|
; CHECK: mov eax, 120
|
|
mov eax, factorial2(4)
|
|
; CHECK: mov eax, 24
|
|
mov eax, 11 + factorial(6) - 11
|
|
; CHECK: mov eax, 720
|
|
|
|
ret
|
|
string_recursive_test ENDP
|
|
|
|
fibonacci MACRO n
|
|
IF n LE 2
|
|
EXITM %1
|
|
ELSE
|
|
EXITM %fibonacci(n-1)+fibonacci(n-2)
|
|
ENDIF
|
|
ENDM
|
|
|
|
expr_recursive_test PROC
|
|
; CHECK-LABEL: expr_recursive_test:
|
|
|
|
mov eax, fibonacci(10)
|
|
; CHECK: mov eax, 55
|
|
|
|
ret
|
|
expr_recursive_test ENDP
|
|
|
|
expand_as_directive_test @CatStr(P, RO, C)
|
|
; CHECK-LABEL: expand_as_directive_test:
|
|
|
|
ret
|
|
expand_as_directive_test ENDP
|
|
|
|
custom_strcat MACRO arg1, arg2
|
|
EXITM <arg1&arg2>
|
|
ENDM
|
|
|
|
expand_as_directive_custom_test custom_strcat(P, ROC)
|
|
; CHECK-LABEL: expand_as_directive_custom_test:
|
|
|
|
ret
|
|
expand_as_directive_custom_test ENDP
|
|
|
|
end
|