I have a large sample (a vector) $\mathbf{x}$ from a random variable $X\sim N(\mu,\sigma^2)$. The variance $\sigma^2$ is known, but the expectation $\mu$ is unknown. I would like to test the null hypothesis $H_0\colon \ \mu\leq 0$ against the alternative $H_1\colon \ \mu>0$ using a likelihood ratio (LR) test. The test statistic is $$ \text{LR}=-2\ln\frac{L(\mathbf{x}\mid\tilde\mu,\sigma^2)}{L(\mathbf{x}\mid\hat\mu,\sigma^2)}. $$ where $\tilde\mu$ is the estimate of $\mu$ under $H_0$ (thus $\tilde\mu\leq 0$) and $\hat\mu$ is the estimate of $\mu$ under $H_0 \cup H_1$ (thus $\hat\mu\in R$).
I expected the asymptotic distribution of $\text{LR}$ under $H_0$ to be $\chi^2(1)$ but I am getting only zeros in a simulation below.
Questions: Why is that? Is my simulation wrong? Or is the test statistic not supposed to have the $\chi^2(1)$ asymptotic distribution under $H_0$, and if so, why?
(Related question: "Failing to obtain $\chi^2(1)$ asymptotic distribution under $H_0$ in a likelihood ratio test: example 1")
n=1e3 # sample size
sigma=1 # standard deviation of X
m=3e3 # number of simulation runs
mu=-1 # particular instance of the null hypothesis used in the simulation
logL0s=logL1s=logLRs=rep(NA,m)
for(i in 1:m){
set.seed(i); x=rnorm(m,mean=mu,sd=sigma)
logL0=sum(log( dnorm(x,mean=min(0,mean(x)),sd=sigma) ))
logL1=sum(log( dnorm(x,mean=max(0,mean(x)),sd=sigma) ))
logLR =-2*(logL0-max(logL0,logL1)) # the -2*ln(LR) statistic from this simulation run
logL0s[i]=logL0; logL1s[i]=logL1; logLRs[i]=logLR
}
summary(logLRs)