view run/b/bug_glue_387_A.d @ 614:e375e824c620

Assertion failure: '!v->csym' on line 387 in file 'glue.c' Sean Kelly <sean@f4.ca> 2005-08-01 news:dclojd$6ak$1@digitaldaemon.com
author thomask
date Sat, 06 Aug 2005 14:32:30 +0000
parents
children 03b5056496f1
line wrap: on
line source

// $HeadURL$
// $Date$
// $Author$

// @author@	Sean Kelly <sean@f4.ca>
// @date@	2005-08-01
// @uri@	news:dclojd$6ak$1@digitaldaemon.com
// @desc@	Assertion failure: '!v->csym' on line 387 in file 'glue.c'

module dstress.run.b.bug_glue_387_A;

enum msync{
    acq,
    rel,
}

template atomicStore(T, msync ms){
	 void atomicStore(T val){
		volatile asm{
			mov EAX, val;
		}
	}
}

struct Atomic(T){
	template store(msync ms){
		void store(){
			atomicStore!(T, ms)(m_val);
		}
	}

	T m_val;
}

template testStore(T, msync ms){
	void testStore(){
		T base;
		Atomic!(T) atom;
		assert(atom.m_val == base);
		atom.store!(ms)();
	}
}

template testType(T){
	void testType(){
		testStore!(T, msync.acq)();
		testStore!(T, msync.rel)();
	}
}

int main(){
	testType!(int)();
	return 0;
}