Object subclass:#CompilerTest
instanceVariableNames:''
classVariableNames:''
poolDictionaries:''
category:'Tests - Compiler'
!
!CompilerTest methodsFor:'tests - constant folding'!
testFloat_pi
^ Float pi
!
testFloat_unity
^ Float unity
!
testFloat_zero
^ Float zero
!
testSmalltalk_if_else_isSmalltalkX
Smalltalk isSmalltalkX ifTrue:[
^ 'yes'
] ifFalse:[
^ 'no'
]
!
testSmalltalk_if_else_isVisualWorks
Smalltalk isVisualWorks ifTrue:[
^ 'yes'
] ifFalse:[
^ 'no'
]
!
testSmalltalk_if_isSmalltalkX
Smalltalk isSmalltalkX ifTrue:[
^ 'yes'
].
^ 'no'
!
testSmalltalk_if_isSqueak
Smalltalk isSqueak ifTrue:[
^ 'yes'
].
^ 'no'
!
testSmalltalk_if_isVisualWorks
Smalltalk isVisualWorks ifTrue:[
^ 'yes'
].
^ 'no'
!
testSmalltalk_isSmalltalkX
^ Smalltalk isSmalltalkX
!
testSmalltalk_isSqueak
^ Smalltalk isSqueak
!
testSmalltalk_isVisualAge
^ Smalltalk isVisualAge
!
testSmalltalk_isVisualWorks
^ Smalltalk isVisualWorks
!
testUnaryFolding
self testFloat_pi ~= (Float perform:#pi) ifTrue:[self halt].
self testFloat_unity ~= (Float perform:#unity) ifTrue:[self halt].
self testFloat_zero ~= (Float perform:#zero) ifTrue:[self halt].
self testSmalltalk_isSmalltalkX ~= (Smalltalk perform:#isSmalltalkX) ifTrue:[self halt].
self testSmalltalk_isSqueak ~= (Smalltalk perform:#isSqueak) ifTrue:[self halt].
self testSmalltalk_isVisualWorks ~= (Smalltalk perform:#isVisualWorks) ifTrue:[self halt].
self testSmalltalk_isVisualAge ~= (Smalltalk perform:#isVisualAge) ifTrue:[self halt].
"
self basicNew testUnaryFolding
"
! !
!CompilerTest class methodsFor:'documentation'!
version
^ '$Header$'
! !